Skip to main content

Grains

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 at mcp.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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for grains-mcp 0.2.0
File Size Uploaded
grains_mcp-0.2.0.tar.gz 19.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for grains-mcp 0.2.0
File Interpreter ABI Platform
grains_mcp-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 35.2 kB

Release files / grains_mcp-0.2.0.tar.gz

Download URL grains_mcp-0.2.0.tar.gz
Size 19.8 kB
Tags Source
SHA-256 checksum
How to use checksums
63dcf321b4b53565a83c269b7fcd2a781590fb92ea2032c85a9d4600c04448e6
BLAKE2b-256 checksum
How to use checksums
44193b2670e2d79763ca2abaa36b464e208b0618c012aa7ef46e89d650a5132d
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.0-py3-none-any.whl

Download URL grains_mcp-0.2.0-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
882d2a239e32d8a7dc53b77a8962df1c2a4d4e196555fb10a47e26516ba403e0
BLAKE2b-256 checksum
How to use checksums
6908339ffd89e5b1c0f8bd6c7fc00d297315abb87cf7a875be89f2dafcd5c0c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page