An open API service indexing awesome lists of open source software.

https://github.com/zuplo/mcp

A fetch API based TypeScript SDK for MCP
https://github.com/zuplo/mcp

ai mcp mcp-server modelcontextprotocol typescript

Last synced: 7 months ago
JSON representation

A fetch API based TypeScript SDK for MCP

Awesome Lists containing this project

README

          

![zuplo mcp logo](assets/zuplo-mcp.png)



@zuplo/mcp


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`](https://github.com/modelcontextprotocol/typescript-sdk)

# ๐Ÿš€ About

`@zuplo/mcp` is a remote server first MCP SDK that aims to be ["minimum common API" compliant as defined by the WinterTC](https://min-common-api.proposal.wintertc.org/).
It uses the [`fetch` APIs](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) and is intended to work out of the box on Zuplo, Node, Deno, Workerd, etc.

# ๐Ÿ“ Documentation

## Quickstart

1. Create an MCP server:

```ts
const server = new MCPServer({
name: "Example Server",
version: "1.0.0",
});
```

2. Add some tools:

```ts
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,
})
});
```

3. Wire up your MCP server with a transport:

```ts
const transport = new HTTPStreamableTransport()
await transport.connect();

server.withTransport(transport);
```

4. Handle a `Request`:

```ts
const response = await transport.handleRequest(httpRequest);
```

# ๐Ÿค Contributing

See the [`CONTRIBUTING.md`](./CONTRIBUTING.md) for further details.