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).
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file grains_mcp-0.2.0.tar.gz.
File metadata
- Download URL: grains_mcp-0.2.0.tar.gz
- Upload date:
- Size: 19.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63dcf321b4b53565a83c269b7fcd2a781590fb92ea2032c85a9d4600c04448e6
|
|
| MD5 |
b2610b87081a8cf3b64f7ad1de924aa3
|
|
| BLAKE2b-256 |
44193b2670e2d79763ca2abaa36b464e208b0618c012aa7ef46e89d650a5132d
|
File details
Details for the file grains_mcp-0.2.0-py3-none-any.whl.
File metadata
- Download URL: grains_mcp-0.2.0-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
882d2a239e32d8a7dc53b77a8962df1c2a4d4e196555fb10a47e26516ba403e0
|
|
| MD5 |
71b0e468eaf8af9342725011b5917bf4
|
|
| BLAKE2b-256 |
6908339ffd89e5b1c0f8bd6c7fc00d297315abb87cf7a875be89f2dafcd5c0c7
|