mcp-kit-core

Matserdam/mcp-kit-core

3.1

If you are the rightful owner of mcp-kit-core and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

MCP Kit is a lightweight, production-ready server toolkit designed for modern runtimes, enabling developers to build tools, prompts, and resources that can run across various platforms like Deno, Bun, and Node.

Tools
1
Resources
0
Prompts
0

@mcp-kit/core

MCP Kit Logo

Lightweight, production-ready MCP server toolkit for modern runtimes. Build tools, prompts, and resources once — run anywhere (Deno, Bun, Node via HTTP fetch).

Why this kit

  • Simple: one server, one fetch handler
  • Portable: edge-first, Node-free public API for JSR
  • Batteries included: tools, prompts, resources (with templates)

Model Context Protocol coverage

The table below summarizes which parts of the official MCP spec (2025-06-18) this kit implements.

StatusDescription
JSON-RPC 2.0 envelopeServer
initializeServer
pingServer
Tools: tools/listServer
Tools: tools/callServer
Prompts: prompts/listServer
Prompts: prompts/getServer
Resources: resources/listServer
Resources: resources/readServer
Resources: resources/templates/listServer
Canonical tools: searchServer
Canonical tools: fetchServer
HTTP transport (fetch)Server
STDIO transportServer
Auth (HTTP OAuth 2.1)Server
Auth (STDIO env)Server
OAuth 2.1 discoveryServer
Event sink/observabilityServer
⬜️Streaming tool outputsServer
⬜️Search/list rootsClient
⬜️Messages APIClient
⬜️Sampling / model / sessionClient

Install

Deno (JSR):

import { MCPServer } from "jsr:@mcp-kit/core";

Bun / Node (via JSR):

npx jsr add @mcp-kit/core
import { MCPServer } from "@mcp-kit/core";

Quick start (Tools + HTTP fetch)

Deno:

import { MCPServer, type MCPToolkit } from "jsr:@mcp-kit/core";
import z from "zod";

const helloInputSchema = z.object({ name: z.string().min(1) });
const helloOutputSchema = z.object({ message: z.string() });

const helloToolkit: MCPToolkit = {
  namespace: "hello",
  tools: [
    {
      name: "hello_say",
      description: "Say hello to a name",
      input: { zod: helloInputSchema },
      output: { zod: helloOutputSchema },
      execute: async ({ name }) => ({
        content: [{ type: "text", text: `Hello, ${name}!` }],
        structuredContent: { message: `Hello, ${name}!` },
      }),
    },
  ],
};

const server = new MCPServer({ toolkits: [helloToolkit] });
Deno.serve((req) => server.fetch(req));

Bun:

import { MCPServer, type MCPToolkit } from "@mcp-kit/core";
import z from "zod";

const helloInputSchema = z.object({ name: z.string().min(1) });
const helloOutputSchema = z.object({ message: z.string() });

const helloToolkit: MCPToolkit = {
  namespace: "hello",
  tools: [
    {
      name: "hello_say",
      description: "Say hello to a name",
      input: { zod: helloInputSchema },
      output: { zod: helloOutputSchema },
      execute: async ({ name }) => ({
        content: [{ type: "text", text: `Hello, ${name}!` }],
        structuredContent: { message: `Hello, ${name}!` },
      }),
    },
  ],
};

const server = new MCPServer({ toolkits: [helloToolkit] });
Bun.serve({ port: 8000, fetch: (req) => server.fetch(req) });

Test with curl:

curl -s -X POST http://localhost:8000 \
  -H 'Content-Type: application/json' \
  -d '{
    "jsonrpc":"2.0", "id":1, "method":"tools/call",
    "params": { "name":"hello_say", "arguments": { "name":"Ada" } }
  }'

Add a Prompt (optional)

import { MCPServer, type MCPToolkit } from "jsr:@mcp-kit/core";

const promptsToolkit: MCPToolkit = {
  namespace: "prompts",
  prompts: [
    {
      name: "greeter",
      title: "Greeter system prompt",
      messages: [
        { role: "system", content: { type: "text", text: "You are a concise assistant." } },
      ],
    },
  ],
};

const server = new MCPServer({ toolkits: [promptsToolkit] });
Deno.serve((req) => server.fetch(req));

Add Resource Templates (optional)

import { createMCPResourceTemplateProvider, MCPServer, type MCPToolkit } from "jsr:@mcp-kit/core";

const templates = createMCPResourceTemplateProvider({
  // task://{id} → render a single task
  templateId: "task",
  uriTemplate: "task://{id}",
  provide: async ({ id }) => ({
    contents: [{
      uri: `task://${id}`,
      name: `Task ${id}`,
      mimeType: "application/json",
      text: JSON.stringify({ id, title: `Task ${id}` }),
    }],
  }),
});

const resourcesToolkit: MCPToolkit = {
  namespace: "resources",
  resourceTemplates: [templates],
};

const server = new MCPServer({ toolkits: [resourcesToolkit] });
Deno.serve((req) => server.fetch(req));

Runtime notes

  • Edge-first: JSR export uses the edge/Deno entry. Use HTTP fetch; STDIO is Node-only.
  • Import paths: use explicit .ts in your own code for Deno projects.

License

MIT