grains-mcp
An MCP server for Grains — build and deploy a hosted agent to grains.run without leaving Claude.
It's a thin client over the Grains control-plane API. Every tool call acts as one Grains user, authenticated by that user's deploy token.
Tools
| Tool | What it does |
|---|---|
grains_scaffold |
Generate grains_app.py + grains.toml for a new agent (framework: none/crewai/langchain/langgraph). Pure local — Claude writes the files. |
grains_deploy |
Create the agent (if new) and deploy the given files. Returns status + the agent's signed identity (did). |
grains_invoke |
Send a task to a deployed agent and return its reply. |
grains_logs |
Recent agent logs. |
grains_list_agents / grains_agent_status |
List / inspect your agents. |
grains_secret_set |
Set an agent secret (e.g. OPENAI_API_KEY). Value is never echoed back. |
grains_set_price |
Make an agent public / set its per-message price (decimal string). |
Setup
Hosted (recommended) — nothing to install, no token to paste; Claude Code opens your browser to sign in with GitHub (OAuth 2.1 + PKCE, dynamic client registration):
claude mcp add --transport http grains https://mcp.grains.run/mcp
Or with a deploy token (from api.grains.run/welcome) as a header, skipping the browser flow:
claude mcp add --transport http grains https://mcp.grains.run/mcp \
--header "Authorization: Bearer grains_dt_your_token_here"
Local — run this same package on your machine (needs uv):
claude mcp add grains \
--env GRAINS_API_URL=https://api.grains.run \
--env GRAINS_DEPLOY_TOKEN=grains_dt_your_token_here \
-- uvx grains-mcp
Claude Desktop or another MCP client? Paste this JSON instead.
{
"mcpServers": {
"grains": {
"command": "uvx",
"args": ["grains-mcp"],
"env": {
"GRAINS_API_URL": "https://api.grains.run",
"GRAINS_DEPLOY_TOKEN": "grains_dt_your_token_here"
}
}
}
}
Then, in Claude: "scaffold a URL-summarizer agent and deploy it to Grains."
Claude calls grains_scaffold, writes the files, calls grains_deploy, and
you can grains_invoke it — all in one conversation.
Transports
- stdio (default) — for the Claude Code config above.
- streamable-http —
grains-mcp --http --port 8080, for hosting atmcp.grains.run(hosted OAuth-backed deployment is a follow-up; today the server authenticates with the deploy token from its env).
Metadata
Release files for grains-mcp 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| grains_mcp-0.2.1.tar.gz | 23.4 kB | Without provenance | Details for grains_mcp-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| grains_mcp-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for grains_mcp-0.2.1-py3-none-any.whl |
Total release size: 41.8 kB
Release files / grains_mcp-0.2.1.tar.gz
| Download URL | grains_mcp-0.2.1.tar.gz |
|---|---|
| Size | 23.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ce439d534a53c19363ae20d6a98f7628d9c4d339d07dff94da0b3185f7b8155
|
|
BLAKE2b-256 checksum How to use checksums |
6be58a3cc181c676e97f1df9968f6d6b25d9518fc06059afe2ea3c6b53a70d92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / grains_mcp-0.2.1-py3-none-any.whl
| Download URL | grains_mcp-0.2.1-py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
982df41b24f34336a47e3886280bddd3d810766ff578c06aa7674f2bced306a2
|
|
BLAKE2b-256 checksum How to use checksums |
4cba894a4dc061f78760606cb0af9060bf79f615b394a372609cc290f9c24a5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for grains-mcp 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.