Getting Started with MCP Server - Agent
MCP Server tutorialLocal with an AI agent
Expose a sample Todo API as an MCP server and test its tools with an MCP client.
Follow along using
Use a coding agent to turn a Todo API into an MCP server. The finished server exposes one read-only tool, which you'll call from MCP Inspector before using it with your agent.
Prerequisites
- Node.js 24 or later.
- An installed coding agent, such as Codex, Claude Code, or Cursor.
- A Zuplo account.
Build your MCP server with an agent
-
Create the project
Run:
CodeWhen prompted, choose Yes to create a matching Portal project, complete sign-in, and select your Zuplo account. Select the coding agent you use when asked. The CLI creates and links the hosted project. See
create-zuplo-api.Zuplo skills
The scaffold installs Zuplo skills in this project for Codex and Cursor and configures the Claude Code plugin. If setup fails, follow Agent Skills from this directory before starting your agent.
-
Ask the agent to expose one tool
Open your agent in the project directory and use this prompt:
CodeFor the underlying configuration, see the MCP Server handler.
-
Review the route and start the server
Check the diff before running the agent's code. The
/mcphandler'soperationslist should contain onlygetTodos, and that ID must matchGET /todos.Start
npm run devif the agent hasn't left it running. In another terminal, run:CodeExpect
200 OKand a JSON response containing todos. -
Test the MCP tool
Start MCP Inspector in another terminal:
CodeOpen the URL printed by Inspector. Select Streamable HTTP, enter
http://localhost:9000/mcp, and connect. List tools: there should be exactly one,getTodos. Run it with an empty arguments object{}. The result should contain the Todo API response without a tool error.A missing tool usually means the
operationIdand handler'siddon't match. If the tool errors, test/todosdirectly to distinguish an upstream problem from an MCP configuration problem. -
Connect your coding agent
For Codex, register the HTTP MCP server from your terminal:
CodeStart a new Codex session so it loads the server. For another client, use its HTTP MCP configuration with the same URL. Keep the gateway running, then ask the agent to
Use getTodos to list the todos. Approve the tool call and check that the response matches the Inspector result.Cloud-hosted clients can't reach your computer's
localhost. To use one, deploy the project and provide its hosted/mcpURL.
This local sample has no authentication. Before exposing private operations, configure MCP server authentication.
Next steps
- Choose tools in the Route Designer to add more operations.
- Configure the MCP Server handler for your API's tools.
- Add authentication before sharing a server that accesses private data.