π¦
server-sdk
Server-side APIs for creating MCP server-side fetch functions
0 installs
Trust: 39 β Low
Devtools
Installation
npx @aklinker1/mcp-server-sdkAsk AI about server-sdk
Powered by Claude Β· Grounded in docs
I know everything about server-sdk. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Loading tools...
Reviews
Documentation
Alternative to the official @modelcontextprotocol/sdk@v1 with:
- Standard Schema compatible validation library support
- WHATWG
fetchstandard support (Bun & Deno servers) - Minimal dependencies (3 packages summing to 62KB vs 90 summing to 14MB)
- Result type builders
[!WARNING]
V2 of the official SDK will likely add support for all my changes. Waiting for that version to be released.
Supported Protocol Versions
| Protocol Version | Supported? |
|---|---|
| 2025-11-25 | β |
| 2025-06-18 | β |
| 2025-03-26 | β |
| 2024-11-05 | β |
| draft | β |
Supported Features
Goal here is to create a generalized MCP
fetchfunction that I can host in my homelab and use in chats that supports Bun.
Installation
npm i @aklinker1/mcp-server-sdk
bun add @aklinker1/mcp-server-sdk
deno add @aklinker1/mcp-server-sdk
Quick Start
// main.ts
import {
createMcpFetchTransport,
definePrompt,
defineTool,
defineResourceTemplate,
} from "@aklinker1/mcp-server-sdk";
import z from "zod";
// Define your prompts, resources, and tools
const examplePrompt = definePrompt({
argsSchema: z.object({
param: z.string(),
}),
handler: async ({ args }) => {
// ...
},
});
const exampleResource = defineResourceTemplate({
uriTemplate: "example://{id}",
uriSchema: z.object({
id: z.string(),
}),
handler: async ({ uri }) => {
// ...
},
});
const exampleTool = defineTool({
inputSchema: z.object({
param: z.string(),
}),
handler: async ({ input }) => {
// ...
},
});
// Create a server-side fetch function
const fetch = createMcpFetchTransport({
toJsonSchema: z.toJSONSchema,
prompts: {
examplePrompt,
},
resources: {
exampleResource,
},
tools: {
exampleTool,
},
});
// Serve the MCP server at http://localhost:3000
Bun.serve({ fetch });
// or
Deno.serve({ fetch });
Then run your server!
bun run main.ts
deno run --allow-net main.ts
MCP Inspector
Use the @modelcontextprotocol/inspector package to inspec your server:
bunx @modelcontextprotocol/inspector@latest --transport http --server-url http://localhost:3000
