A fetch
API based, remote server first, TypeScript SDK for MCP.
About
Β·
Documentation
Β·
Contributing
π§ Warning! In active development! π§
Attributions
Inspired by (with MIT Licensed attributions) - modelcontextprotocol/typescript-sdk
@zuplo/mcp
is a remote server first MCP SDK that aims to be "minimum common API" compliant as defined by the WinterTC.
It uses the fetch
APIs and is intended to work out of the box on Zuplo, Node, Deno, Workerd, etc.
- Create an MCP server:
const server = new MCPServer({
name: "Example Server",
version: "1.0.0",
});
- Add some tools:
server.addTool({
name: "add",
description: "Adds two numbers together and returns the result.",
validator: new ZodValidator(
z.object({
a: z.number().describe("First number"),
b: z.number().describe("Second number")
})
),
handler: async ({ a, b }) => ({
content: [{ type: "text", text: String(a + b) }],
isError: false,
})
});
- Wire up your MCP server with a transport:
const transport = new HTTPStreamableTransport()
await transport.connect();
server.withTransport(transport);
- Handle a
Request
:
const response = await transport.handleRequest(httpRequest);
See the CONTRIBUTING.md
for further details.