{
  "markdown": "# Felix MCP (Smithery)\r\n\r\nA tiny **Model Context Protocol** server with a few useful tools, deployed on **Smithery**, tested in **Claude Desktop**, and indexed in **NANDA**.\r\n\r\n**Tools included**\r\n\r\n* `hello(name)` – quick greeting\r\n* `randomNumber(max?)` – random integer (default 100)\r\n* `weather(city)` – current weather via wttr.in\r\n* `summarize(text, maxSentences?, model?)` – OpenAI-powered summary *(requires `OPENAI_API_KEY`)*\r\n\r\n**Public server page**\r\n`https://smithery.ai/server/@FelixYifeiWang/felix-mcp-smithery`\r\n\r\n**MCP endpoint (streamable HTTP)**\r\n`https://server.smithery.ai/@FelixYifeiWang/felix-mcp-smithery/mcp`\r\n*(In Smithery/NANDA, auth is attached via query param `api_key` and optional `profile`, configured in the platform UI; do **not** hardcode secrets here.)*\r\n\r\n---\r\n\r\n## Demo\r\n\r\n### In Claude Desktop (recommended)\r\n\r\n1. Open **Settings → Developer → mcpServers** and add:\r\n\r\n   ```json\r\n   {\r\n     \"mcpServers\": {\r\n       \"felix-mcp-smithery\": {\r\n         \"command\": \"npx\",\r\n         \"args\": [\r\n           \"-y\",\r\n           \"@smithery/cli@latest\",\r\n           \"run\",\r\n           \"@FelixYifeiWang/felix-mcp-smithery\",\r\n           \"--key\",\r\n           \"YOUR_SMITHERY_API_KEY\",\r\n           \"--profile\",\r\n           \"YOUR_PROFILE_ID\"\r\n         ]\r\n       }\r\n     }\r\n   }\r\n   ```\r\n2. Start a new chat and run:\r\n\r\n   * “List tools from **felix-mcp-smithery**”\r\n   * “Call **hello** with `{ \"name\": \"Felix\" }`”\r\n   * “Call **summarize** on this text (2 sentences): …”\r\n\r\n\r\n---\r\n\r\n## Features\r\n\r\n* **Streamable HTTP MCP** – Express + MCP SDK’s `StreamableHTTPServerTransport` on `/mcp` (POST/GET/DELETE).\r\n* **Session-aware** – proper handling of `Mcp-Session-Id` (no close recursion).\r\n* **OpenAI summarization** – tidy summaries via chat completions (model default `gpt-4o-mini`).\r\n* **Zero-friction hosting** – packaged as a container and deployed on Smithery.\r\n\r\n---\r\n\r\n## Install (local)\r\n\r\n> Requires **Node 18+** (tested on Node 20).\r\n\r\n```bash\r\ngit clone https://github.com/FelixYifeiWang/felix-mcp-smithery\r\ncd felix-mcp-smithery\r\nnpm install\r\n```\r\n\r\nSet env (only needed if you’ll call `summarize` locally):\r\n\r\n```bash\r\nexport OPENAI_API_KEY=\"sk-...\"\r\n```\r\n\r\nRun:\r\n\r\n```bash\r\nnode index.js\r\n# ✅ MCP Streamable HTTP server on 0.0.0.0:8081 (POST/GET/DELETE /mcp)\r\n```\r\n\r\nLocal curl:\r\n\r\n```bash\r\ncurl -s -X POST \"http://localhost:8081/mcp\" \\\r\n  -H 'Content-Type: application/json' \\\r\n  -H 'Mcp-Protocol-Version: 2025-06-18' \\\r\n  --data '{\"jsonrpc\":\"2.0\",\"id\":0,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2025-06-18\"}}'\r\n```\r\n\r\n---\r\n\r\n## Usage (tools)\r\n\r\n**hello**\r\n\r\n```json\r\n{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"hello\",\"arguments\":{\"name\":\"Felix\"}}}\r\n```\r\n\r\n**randomNumber**\r\n\r\n```json\r\n{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools/call\",\"params\":{\"name\":\"randomNumber\",\"arguments\":{\"max\":10}}}\r\n```\r\n\r\n**weather**\r\n\r\n```json\r\n{\"jsonrpc\":\"2.0\",\"id\":3,\"method\":\"tools/call\",\"params\":{\"name\":\"weather\",\"arguments\":{\"city\":\"Boston\"}}}\r\n```\r\n\r\n**summarize** *(needs `OPENAI_API_KEY` set on the server)*\r\n\r\n```json\r\n{\"jsonrpc\":\"2.0\",\"id\":4,\"method\":\"tools/call\",\"params\":{\"name\":\"summarize\",\"arguments\":{\"text\":\"(paste long text)\",\"maxSentences\":2}}}\r\n```\r\n\r\n---\r\n\r\n## How it works\r\n\r\n* **Server core:**\r\n  `McpServer` from `@modelcontextprotocol/sdk` with tools registered in `buildServer()`.\r\n  Transport: `StreamableHTTPServerTransport` on `/mcp` handling:\r\n\r\n  * `POST /mcp` — JSON-RPC requests (and first-time `initialize`)\r\n  * `GET /mcp` — server-to-client notifications (SSE)\r\n  * `DELETE /mcp` — end session\r\n* **CORS:** Allows all origins; exposes `Mcp-Session-Id` header (good for hosted clients).\r\n* **OpenAI summarize:** Thin `fetch` wrapper around `/v1/chat/completions` with a short “crisp summarizer” system prompt.\r\n\r\n---\r\n\r\n## Deployment (Smithery)\r\n\r\n1. GitHub repo with:\r\n\r\n   * `index.js` (Express + MCP)\r\n   * `package.json` (`@modelcontextprotocol/sdk`, `express`, `cors`, `zod`)\r\n   * `Dockerfile`\r\n   * `smithery.yaml`:\r\n\r\n     ```yaml\r\n     kind: server\r\n     name: felix-mcp-smithery\r\n     version: 1.0.0\r\n     runtime: container\r\n\r\n     startCommand:\r\n       type: http\r\n\r\n     transport: streamable-http\r\n     port: 8081\r\n     path: /mcp\r\n     ssePath: /mcp\r\n     health: /\r\n     ```\r\n2. In Smithery:\r\n\r\n   * Create server from the repo.\r\n   * Add **Environment Variables**: `OPENAI_API_KEY` (optional for `summarize`).\r\n   * Deploy → confirm logs show:\r\n     `✅ MCP Streamable HTTP server on 0.0.0.0:8081 (POST/GET/DELETE /mcp)`\r\n\r\n---\r\n\r\n## NANDA Index\r\n\r\n* Go to **join39.org → Context Agents → Add**\r\n\r\n  * **Agent Name:** `Felix MCP (Smithery)`\r\n  * **MCP Endpoint:**\r\n    `https://server.smithery.ai/@FelixYifeiWang/felix-mcp-smithery/mcp?api_key=YOUR_KEY&profile=YOUR_PROFILE`\r\n  * **Description:**\r\n    `Streamable-HTTP MCP hosted on Smithery. Tools: hello, randomNumber, weather, summarize (OpenAI).`\r\n\r\n* Test from NANDA: `initialize` → `tools/list` → call `hello`.\r\n\r\n---\r\n\r\n## Project structure\r\n\r\n```\r\n.\r\n├─ index.js            # Express + Streamable HTTP + tools\r\n├─ package.json        # sdk/express/cors/zod\r\n├─ Dockerfile          # container build for Smithery\r\n└─ smithery.yaml       # Smithery project config\r\n```\r\n\r\n---\r\n\r\n## Assignment rubric mapping\r\n\r\n* ✅ **Find/Build:** Custom MCP server with 4 tools\r\n* ✅ **Deploy:** Hosted on Smithery (public server page linked)\r\n* ✅ **Test in a host:** Verified in Claude Desktop (screenshots/recording included)\r\n* ✅ **NANDA Index:** Added as a Context Agent (screenshot included)\r\n* ✅ **Deliverables:** Repo link + working endpoint + host screenshots\r\n\r\n---\r\n\r\n## What worked\r\n\r\n* Streamable HTTP transport with session management is stable once the close-loop gotcha is avoided.\r\n* Smithery makes deployment + auth key distribution straightforward.\r\n* Claude Desktop connects cleanly via `@smithery/cli run …`.\r\n\r\n---\r\n\r\n## AI Acknowledgement\r\n\r\nParts of this project (tool scaffolding, error fixes, and documentation polish) were produced with AI assistance.\r\nThe final code, deployment, and testing steps were implemented and verified by me.\r\n",
  "bytes": 6097,
  "sha": "d4b423b1bb6cf45dbde51f42d8437965625d2955536578e3c70d22c0c3a5434e",
  "repo_slug": "felixyifeiwang/felix-mcp-smithery",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_ai_smithery_felixyifeiwang_felix_mcp_smi_c68665e2/readme"
}