Guarantee: strictly read-only — no writes, no network, no arbitrary URLs
Installation
Two supported install paths. Both run the same read-only stdio server and read the same
snippets-index.json registry and library/ tree as the CLI —
the MCP never creates a second database.
1. From PyPI (recommended)
terminal
$pipinstalldevsnips-mcp
2. From the DevSnips repository
Useful if you want to pin to a commit, patch the server, or run entirely from a local checkout without publishing a package.
Requires Python 3.10+. Package source lives at
integrations/mcp.
Tools
The MCP server exposes exactly four tools. Call them in this order for best results:
Plan — list_facets answers "what does DevSnips actually contain?"
Search — search_resources answers "which resources match this query?"
Inspect — get_resource answers "what does this resource include?"
Read — get_resource_file answers "show me the code, one file at a time."
Search supports both exact and fuzzy modes and matches across
name, description, tags and family. When a query
matches nothing, the server retries with spelling variants and prefix matching instead of
returning an empty page.
search_resources
Discover resources by keyword, technology, type and pagination.
The server is intentionally constrained. Every guarantee below is enforced in code, not convention — the agent cannot ask it to do more than read.
Read-only guarantee
No tool writes to the library, registry, or filesystem.
No network fetches — all content is served from the on-disk registry.
No arbitrary URL or path arguments are accepted by any tool.
Path gates
Every id and file is resolved through the registry and clamped to the library/ tree. Requests that escape the root, use .., or reference files outside the resource manifest are rejected with structured errors.
Caching
The registry is loaded once per process and cached in memory. get_resource_file results are memoised per session keyed on id + file + maxBytes. Disable with DEVSNIPS_MCP_CACHE=0 when developing against a live registry.
Structured errors
error.json
{"ok":false,"error":{"code":"PATH_OUT_OF_SCOPE","message":"File is not in the resource manifest."}}
Exceptions never cross the transport.
Local mode
Point the server at a local checkout or a custom registry path with DEVSNIPS_MCP_SOURCE. Useful when you maintain your own snippets next to the DevSnips library.
environment
DEVSNIPS_MCP_SOURCE=/path/to/DevSnips
Configuration
All settings are environment variables. Defaults are tuned for the public DevSnips registry.
DEVSNIPS_MCP_SOURCE
Path to a local DevSnips checkout or custom registry. Overrides the bundled registry.
DEVSNIPS_MCP_CACHE
1 | 0 — enable in-memory caching. Default 1.
DEVSNIPS_MCP_CACHE_TTL
Cache TTL in seconds. Default 300.
DEVSNIPS_MCP_MAX_BYTES
Default max bytes per returned file. Default 65536.
DEVSNIPS_MCP_LOG_LEVEL
debug | info | warn | error. Default info.
How it works
DevSnips Library
↓
Resource Registry — snippets-index.json
↓
DevSnips MCP
↓
AI Coding Agent
MCP exposes the existing DevSnips library to the agent rather than generating a separate library. Supported registry schema is 2.0; v1 is strictly read-only.