loading…
Search for a command to run...
loading…
A demonstration MCP server built with TypeScript and Bun that implements a classic Magic 8-Ball oracle. It enables users to ask yes/no questions, use prompt tem
A demonstration MCP server built with TypeScript and Bun that implements a classic Magic 8-Ball oracle. It enables users to ask yes/no questions, use prompt templates, and access the full list of classic responses.
A demo Model Context Protocol server that implements a classic Magic 8-Ball oracle. Built with TypeScript and Bun.
| MCP Primitive | Name | Description |
|---|---|---|
| Tool | shake |
Ask a yes/no question, get a random 8-Ball answer |
| Prompt | ask-the-8-ball |
Reusable prompt template for consulting the oracle |
| Resource | magic-8-ball://responses |
The complete list of 20 classic responses |
.mcpb bundle)# Install dependencies
bun install
# Run the server directly (stdio transport)
bun run start
The MCP Inspector provides a browser UI for interacting with your server.
bun run inspect
This opens http://localhost:6274 where you can:
shake with a question and see random 8-Ball responsesask-the-8-ball prompt template with a question filled inmagic-8-ball://responses to see all 20 classic answersCompile TypeScript to JavaScript so the bundle can run with Node.js (which ships with Claude Desktop):
bun run build
This creates dist/index.js — a single-file bundle with all dependencies included.
If you haven't already, initialize the MCPB manifest:
bunx @anthropic-ai/mcpb init
A manifest.json is already included in this repo. You can validate it:
bunx @anthropic-ai/mcpb validate manifest.json
bunx @anthropic-ai/mcpb pack .
This creates a .mcpb file (e.g., magic-8-ball-mcp-1.0.0.mcpb).
Double-click the .mcpb file (or open it with Claude Desktop). Claude will show an installation dialog — click Install and the Magic 8-Ball tools will be available in your conversations.
bun-demo-mcp/
├── .claude/
│ └── CLAUDE.md # Claude Code project instructions
├── dist/
│ └── index.js # Compiled bundle (generated)
├── src/
│ ├── index.ts # MCP server (tool + prompt + resource)
│ └── responses.ts
├── bun.lock
├── manifest.json # MCPB bundle manifest
├── package.json
├── README.md
└── tsconfig.json
MIT
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"magic-8-ball-mcp-server": {
"command": "npx",
"args": []
}
}
}