What is an MCP server?
An MCP server is a program that exposes tools to an AI host (Claude Desktop, Cursor, Claude Code, VS Code, Codex and others) over the open Model Context Protocol.
In AI assistants, MCP is how the model reaches beyond the chat window: the host starts your server, asks for tools/list, and sends tools/call when the model picks a tool.
Short on time? Generate a runnable TypeScript or Python stdio server from a form on the MCP Server Generator homepage—no OpenAPI required.
What is MCP in AI?
MCP stands for Model Context Protocol. In AI products it is the open way for a host application to give a language model safe, structured access to capabilities you control—lookup, search, run a script, call an internal API—without baking every integration into the model weights or pasting secrets into the chat.
Three roles matter:
- Host — the app the user talks to (Claude Desktop, Cursor, Claude Code, VS Code with MCP, Windsurf, Codex, and other MCP clients).
- Model — the LLM that decides when a tool might help and which arguments to pass.
- MCP server — the small program you write (or generate) that implements the tools. The host launches it and speaks MCP to it; the model never talks to your server directly.
That split is why MCP shows up in “what is MCP in AI” and “what’s an MCP server” searches: people want the protocol idea first, then a concrete server they can run next to Cursor or Claude Desktop.
How an MCP server works
At runtime the loop is short and deliberate. Understanding tools/list and tools/call is enough to read most MCP docs and generator output.
- Launch. The host starts your server as a child process (stdio) or connects to a remote endpoint (Streamable HTTP). Local generators on this site write stdio servers.
- Initialize. Host and server exchange protocol version and capabilities.
tools/list. The host asks for every tool: name, description, and a JSON Schema (inputSchema) for arguments. Those descriptions are written for the model, not for a human API consumer.- Model chooses. When the user asks something that needs your capability, the model picks a tool name and fills arguments that match the schema.
tools/call. The host sends the call to your server. Your handler runs and returns text content (and optionally structured content). The host feeds that result back into the conversation.
stdio vs Streamable HTTP
| Transport | Typical use | Notes |
|---|---|---|
| stdio | Local desktop / IDE hosts | Host launches command + args from config (for example claude_desktop_config.json or Cursor mcp.json). Log only to stderr; stdout is the protocol stream. |
| Streamable HTTP | Shared / remote servers | Server listens on HTTP; hosts connect with a URL (and often auth headers). Same tools surface; different launch and security model. |
A tested walkthrough of the same tools over both transports is in the TypeScript and Python MCP server template. For connecting a finished server to five hosts, see connect an MCP server to Claude Desktop, Cursor and Claude Code.
MCP server vs API
An API is a contract for clients you write. An MCP server is a contract for the model: tool names and descriptions are written so the LLM can choose when to call them. You can wrap an existing REST API as MCP tools, or expose a script or database query that never had an OpenAPI spec.
| Dimension | Typical API | MCP server |
|---|---|---|
| Caller | Your code, another service, or a script | The model, via an MCP host |
| Discovery | Docs, OpenAPI, SDKs | tools/list (names + descriptions + JSON Schema) |
| Unit of work | Often HTTP path + method | A task-shaped tool (lookup_customer, not only GET /v1/customers) |
| Auth surface | Tokens for every client | Usually process env / host config; remote HTTP needs its own auth story |
| Transport | HTTP/gRPC/etc. | stdio into the host, or Streamable HTTP |
| Can they combine? | Yes — call the API inside an MCP tool handler. See build an MCP server for an internal API and the OpenAPI to MCP converter. | |
Side-by-side on one example API (form-built tools vs OpenAPI-converted tools): MCP Server Generator vs OpenAPI generators.
What an MCP server can expose
The protocol defines more than tools. Most first servers ship tools only; resources and prompts are optional but useful once you know the basics.
Tools
Tools are callable actions. Each has a name, a description the model reads, and an inputSchema (JSON Schema). Optional annotations (for example read-only or destructive hints) and an outputSchema help hosts and models use the tool safely. Design and validate schemas with the free MCP tool schema generator.
Example shape the host sees from tools/list:
{
"name": "get_weather",
"description": "Get current weather for a city",
"inputSchema": {
"type": "object",
"properties": {
"city": { "type": "string", "description": "City name, e.g. San Francisco" }
},
"required": ["city"]
}
}
Resources
Resources are readable data the host can fetch by URI (for example a file, a config blob, or a curated document). They are not “called” with arguments the way tools are; they are listed and read. Use them when the model needs reference material more than an action.
Prompts
Prompts are reusable prompt templates the host can offer to the user or inject into a workflow. They package instructions you want applied consistently, separate from tool execution.
Working TypeScript and Python examples of a resource and a prompt (alongside tools) are in the MCP server template walkthrough.
How to get an MCP server without OpenAPI
You do not need an OpenAPI or Swagger file to create an MCP server. Many useful first servers are three or four task tools around a script, a database query, or a private endpoint that was never published as a spec.
- Form → ZIP. On the MCP Server Generator homepage, name the server, add tools with typed parameters, choose TypeScript or Python, and download a stdio project with README host config. Handlers start as stubs—replace the TODOs.
- Step-by-step tutorial. How to create an MCP server without OpenAPI walks through SDK, tools, handlers, stdio, test, and host config, then the form path.
- Template walkthrough. MCP server example and template for TypeScript and Python shows every generated file and how to add tools, resources and prompts.
Prefer someone else to build it? See the MCP server development service.
Already have an OpenAPI spec?
If you maintain OpenAPI 3 or Swagger 2.0, converting selected operations into MCP tools that send real HTTP requests is often faster than rewriting every handler by hand.
- OpenAPI to MCP converter — paste, upload or fetch a spec; download a TypeScript or Python server with one tool per selected operation.
- Form generator vs OpenAPI — same example API, compared on tool count, naming, auth and real HTTP handlers.
Convert, then prune: long lists of endpoint-shaped tools make it harder for the model to choose correctly. Expose only what the agent needs.
Connect, configure, schema and test
Once you have a server project:
- Connect & config — Connect an MCP server to Claude Desktop, Cursor and Claude Code covers paths for five hosts. The MCP config generator and validator writes or checks
claude_desktop_config.json, Cursor / VS Codemcp.json, Claude Code.mcp.jsonand Codexconfig.toml. - Schema — Use the MCP tool schema generator for richer inputs (enums, arrays, annotations, optional
outputSchema) and to validate pastedtools/listJSON. - Test — Before touching a host, run how to test an MCP server with MCP Inspector (web UI and CLI), failure paths and a CI smoke pattern.
When to use a generator vs write by hand
| Situation | Prefer |
|---|---|
| A few task tools, no OpenAPI, want a ZIP with stdio + host config today | Form generator |
| Maintained OpenAPI/Swagger and want real HTTP tools quickly | OpenAPI to MCP converter |
| Learning the protocol or need full control over every line | Hand-written SDK (start from the template example) |
| Private REST API with a token, custom error shaping | Build an MCP server for an internal API |
Create your first MCP server
Describe tools in a form, download TypeScript or Python, test with Inspector, then paste the README config into your host.
FAQ
What is an MCP server?
An MCP server is a program that exposes tools (and optionally resources and prompts) to an AI host such as Claude Desktop, Cursor or Claude Code over the Model Context Protocol. The host starts the server, lists its tools, and calls one when the model decides to use it, then passes the result back to the model.
What's an MCP server in plain terms?
It is a small local (or remote) process that turns actions you control—lookup a customer, run a script, call an internal API—into named tools an AI assistant can choose and invoke safely, instead of pasting secrets into the chat.
What is MCP in AI?
In AI products, MCP (Model Context Protocol) is the open way for a host app to give the model structured access to tools you control. The MCP server implements those tools; the host is Claude Desktop, Cursor, Claude Code, VS Code, Codex or another MCP client. Spec overview: modelcontextprotocol.io.
How does an MCP server work?
The host launches your server (here often over stdio), sends tools/list to learn names, descriptions and JSON Schemas, then tools/call with arguments when the model picks a tool. Your handler runs and returns text (or structured content) that the host feeds back into the conversation.
MCP server vs API: what is the difference?
An API is called by code you write. An MCP server is called by the model through a host: tools must be named and described for the LLM, and the transport is typically stdio or Streamable HTTP. You can still call an API inside an MCP tool handler—see build an MCP server for an internal API.
Is an MCP server the same as a plugin or GPT action?
No. Plugins and GPT actions are usually tied to one vendor's product and often map HTTP endpoints. MCP is an open protocol: the same local stdio server can be launched by Claude Desktop, Cursor, Claude Code, VS Code, Windsurf, Codex and other hosts that speak MCP.
Do I need OpenAPI to create an MCP server?
No. Many first MCP servers are a handful of task-shaped tools with no REST spec. Use the form generator or write the SDK by hand (tutorial). If you already maintain a spec, use the OpenAPI to MCP converter.
What can an MCP server expose besides tools?
Besides tools (callable actions), an MCP server can expose resources (readable data by URI) and prompts (reusable prompt templates). Most starter servers ship tools first; see examples in the template guide.