BM

backspaces/mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

0 stars 0 forks 质量 66 趋势 20

Small MCP servers to copy from, one file each, over a shared mcp.ts. Run locally over stdio or on the web.

概览

Small MCP servers to copy from. Each is one file in servers/, and mcp.ts does the MCP part, so a server file is just what it offers. MCP is not an AI. An MCP server adds abilities to an AI app you already use (Claude, Codex, ChatGPT, …): the app is the client, and it calls the server. Both list a prompt in the / menu as / : , so /recipes:plan_meal, tagged (MCP) to show it comes from a server. Pick it there and fill in the blanks when asked. In the terminal, the older spelling /mcp__plan_meal 6 also works when typed out, with arguments separated by spaces (so each argument is one word). Either way the server has to be connected first: right after claude starts, or before you've approved .mcp.json, you get "Unknown command". /mcp shows which servers are connected. VS Code's @ lists only workspace files, not resources, so there you ask Claude to read one instead. Tools are the main event. Many apps support only tools, so treat resources and prompts as extras. - hello.

README

以下为原文 README 节选,完整内容请查看原文。

MCP

Small MCP servers to copy from. Each is one file in servers/, and mcp.ts does the MCP part, so a server file is just what it offers.

MCP is not an AI. An MCP server adds abilities to an AI app you already use (Claude, Codex, ChatGPT, …): the app is the client, and it calls the server.

The three things a server can offer

Kind Who uses it What it’s for Claude Code in the terminal Claude Code in VS Code
Tools the model, when it decides to do something or look something up used automatically used automatically
Resources you (or the app) attach them read-only data, each at a URI type @recipes: and pick one ask: “read recipe://pancakes”
Prompts you pick them canned instructions with blanks type /recipes: and pick one type /recipes: and pick one

Both list a prompt in the / menu as /:, so /recipes:plan_meal, tagged (MCP) to show it comes from a server. Pick it there and fill in the blanks when asked. In the terminal, the older spelling /mcp__recipes__plan_meal 6 also works when typed out, with arguments separated by spaces (so each argument is one word). Either way the server has to be connected first: right after claude starts, or before you’ve approved .mcp.json, you get “Unknown command”. /mcp shows which servers are connected.

VS Code’s @ lists only workspace files, not resources, so there you ask Claude to read one instead.

Tools are the main event. Many apps support only tools, so treat resources and prompts as extras.

The servers

  • hello.ts has one tool, greet. It’s the minimal template.
  • dice.ts has two tools, roll_dice and flip_coin, with arguments that have limits and defaults.
  • recipes.ts offers all three kinds over a few recipes:
    • the tool search_recipes
    • the resources recipe://index and recipe://{name}
    • the prompt plan_meal

Running one in Claude Code

Claude Code (the claude CLI, and the Claude Code panel in VS Code) starts the servers itself over stdio. Nothing is left running, and there’s nothing to host. All three are listed in .mcp.json, so starting Claude Code in this repo picks them up, after a one-time approval. To add a new one, run this from the repo:

claude mcp add --scope project dice -- deno run -A ./servers/dice.ts --stdio
Part Read by Meaning
claude mcp add Claude Code add a server to its list
--scope project Claude Code save it in .mcp.json here (the default, local, is private to you)
(no --transport) Claude Code stdio is the default: Claude Code starts the program itself
dice Claude Code the server’s name, as in /mcp and mcp__dice__roll_dice
-- Claude Code the rest is the server’s command, so -A isn’t read as a claude option
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →