permissions. Any tool you register can be called by the connected agent, so do not expose functions that delete data or spend money without your own checks.
Who it is forA developer who wants an AI agent to use one of their own functions.
The problemAgents cannot call your internal logic until it is wrapped in a protocol they speak.
The outcomeA running stdio MCP server with one registered tool that any MCP client can list and call.
What you need first
- Node.js with npm, or Bun or Deno as the README shows
- The server package from `npm install @modelcontextprotocol/server`, or the client package from `npm install @modelcontextprotocol/client`
- zod for tool input schemas, as in the README example
Steps
- Install the server package with
npm install @modelcontextprotocol/server - Create an McpServer with a name and version, as in the README Getting Started example
- Register a tool with server.registerTool, giving it a description and a zod inputSchema, like the greet example
- Connect a StdioServerTransport with server.connect and add the server to your MCP client
Prompt for your agent
Using modelcontextprotocol/typescript-sdk, install it with `npm install @modelcontextprotocol/server` and build a stdio MCP server that exposes <my function> as a tool with registerTool and a zod inputSchema, following the greet example.
Caveat. The README points to the docs tutorials for a full weather alert server; the snippet is a minimal greet tool.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for modelcontextprotocol/typescript-sdk and "Build your first MCP tool server in TypeScript"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer