Repository navigation
Add a read-only Pi Index MCP server - #59
Merged
Merged
Conversation
Publish the directory as /catalog.json and query it over stdio so agents can search packages, categories, and guides without writes or tracking. Co-authored-by: Kieran <bubbleptr@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Agents can query the Pi Index directory over a read-only stdio MCP server. Search uses the same case-insensitive AND match as
https://piindex.dev/?q=. Every result includes apiindexUrl. There are no write tools, no auth, and no analytics. The only network call is a GET of the public catalog.This PR does not publish to npm or the MCP Registry, and it should not be merged by the agent that opened it.
Package name
Checked the npm registry on 2026-10-15. All three names 404:
piindex-mcp(chosen)@bubbleptr/piindex-mcp@piindex/mcppiindex-mcpis unscoped so clients can runnpx -y piindex-mcp. The registry server name isio.github.bubbleptr/piindex, which matches GitHub auth for thebubbleptraccount.package.jsonmcpNameis the same string.Data
The site now builds
/catalog.jsonfrom the README catalog, stats snapshot, and published guides (178 packages in this snapshot). The MCP server fetcheshttps://piindex.dev/catalog.json, caches it in memory for 15 minutes, and falls back tomcp/catalog.snapshot.jsonif the site is unreachable. Queries are not sent anywhere.No streamable-HTTP endpoint. The site is a static Astro build (
output: 'static') deployed as files on Vercel. A remote MCP transport would need a server runtime on each request, which is a hosting change rather than a small static route.Tools
search_packagescategory, same rules as?q=and?category=.get_packagelist_categorieslist_packageslist_guidespiindexUrlis the package guide when one is published, otherwise the directory search for that name.guideUrlis set only for a package guide. Topic and category guides that mention the package are listed onguides.Sample output
Captured locally against the real catalog snapshot (
statsGeneratedAt2026-10-12T09:16:23.459Z).search_packageswithquery: "子代理",category: "subagents",limit: 2returned 9 matches. First page:{ "directoryUrl": "https://piindex.dev/?q=%E5%AD%90%E4%BB%A3%E7%90%86&category=subagents", "total": 9, "packages": [ { "name": "pi-subagents", "description": "Community subagent extension maintained by Nico Bailon (nicobailon), with chain, parallel execution, and TUI clarification.", "descriptionZh": "Nico Bailon(nicobailon)维护的社区子代理扩展,支持链式、并行执行和 TUI 澄清。", "install": "pi install npm:pi-subagents", "stars": 3905, "weeklyDownloads": 99943, "piindexUrl": "https://piindex.dev/?q=pi-subagents", "guideUrl": null }, { "name": "@tintinweb/pi-subagents", "description": "Claude Code-style subagents using host SDK sessions, with parallel background tasks, live widgets and optional Git worktree isolation.", "install": "pi install npm:@tintinweb/pi-subagents", "stars": 1290, "weeklyDownloads": 7918, "piindexUrl": "https://piindex.dev/packages/tintinweb-pi-subagents/", "guideUrl": "https://piindex.dev/packages/tintinweb-pi-subagents/" } ] }get_packageforpi-web-access:{ "name": "pi-web-access", "description": "Web search, URL fetching, PDF extraction and YouTube analysis. Keyless search defaults to Exa MCP with configured fallbacks; DuckDuckGo is explicit-only.", "descriptionZh": "Web 搜索、URL 获取、PDF 提取与 YouTube 理解;默认免 Key 搜索使用 Exa MCP,按配置降级,DuckDuckGo 需显式选择。", "install": "pi install npm:pi-web-access", "projectUrl": "https://github.com/nicobailon/pi-web-access", "repoUrl": "https://github.com/nicobailon/pi-web-access", "npmUrl": "https://www.npmjs.com/package/pi-web-access", "stars": 1620, "weeklyDownloads": 191682, "weeklyTrendPercent": -17, "piindexUrl": "https://piindex.dev/packages/pi-web-access/", "guideUrl": "https://piindex.dev/packages/pi-web-access/", "guides": [ { "kind": "category", "slug": "web-access-search", "piindexUrl": "https://piindex.dev/categories/web-access-search/" }, { "kind": "package", "slug": "pi-web-access", "piindexUrl": "https://piindex.dev/packages/pi-web-access/" } ] }list_categoriesincludes Web Access & Search ashttps://piindex.dev/?category=web-access-searchwith guidehttps://piindex.dev/categories/web-access-search/(8 packages).list_guidesreturns the two topics (jev,pi-durable), the two category guides, and the three package guides.A search for
Bravereturns only@juicesharp/rpiv-web-tools.Brave missingreturns nothing, matching the directory's AND behavior.Tests
site:bun run validate(unit tests,astro check, static build including/catalog.json, rendered tests).mcp:npm test— 12 tests. Tools run in-memory and over the stdio entrypoint against the real snapshot.server.jsonvalidates againsthttps://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json.Publish steps
Do these after this PR is merged and the site deploy has published
https://piindex.dev/catalog.json. Until that URL is live, the server still answers from the bundled snapshot. Nothing here has been published.From a checkout of
main, with Bun available and the site dependencies installed:npm publishrunsprepublishOnly, which refreshescatalog.snapshot.jsonfrom the README catalog and runs the tests before uploading.piindex-mcpis unscoped, so do not pass--access public.Confirm the package is on npm and that its
mcpNameisio.github.bubbleptr/piindex:Install
mcp-publisherand log in with the GitHub account that ownsbubbleptr(a different GitHub user cannot publish underio.github.bubbleptr):mcp-publisher login githubprints a device code. Authorize it athttps://github.com/login/deviceasbubbleptr, then runmcp-publisher publishfrommcp/so it picks upserver.json. npm must already show0.1.0; the registry checksmcpNameon the published package.Confirm the listing:
curl "https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.bubbleptr/piindex"Install snippets for Cursor, Claude Desktop, VS Code, and Pi are in
mcp/README.md(English, plus a short 中文 section).