Soma
UnexploredRMCP runtime for provider-backed agents with CLI, REST, HTTP MCP, plugins, and scaffold support.
Install
Terminal
$npx -y @dinglebear/soma mcpmcp_config.json
{
"mcpServers": {
"ai-dinglebear-soma": {
"env": {
"RUST_LOG": "${RUST_LOG}",
"SOMA_HOME": "${SOMA_HOME}",
"SOMA_API_KEY": "${SOMA_API_KEY}",
"SOMA_API_URL": "${SOMA_API_URL}",
"SOMA_PROVIDER_DIR": "${SOMA_PROVIDER_DIR}"
},
"args": [
"-y",
"@dinglebear/soma",
"mcp"
],
"command": "npx"
}
}
}Documentation
Soma
RMCP runtime for provider-backed agents with CLI, REST, HTTP MCP, plugins, and scaffold support.
API docs ā rustdoc for every
workspace crate plus the Redoc-rendered OpenAPI reference, deployed to GitHub
Pages from main.
Soma is a batteries-included server runtime and shipping binary for bringing new agent capabilities online with as little custom Rust as possible. It locks in the production patterns that every server in the family keeps rediscovering: one compact MCP tool, stdio and Streamable HTTP transports, CLI parity, direct REST routes, auth/OAuth, observability, plugin packaging, web fallback, Docker/runtime samples, generated contracts, and release automation.
The repository can still scaffold a renamed project, but Soma is now a shipped
runtime first. The default product path is to run soma in an explicit mode,
drop provider files into providers/ (or point SOMA_PROVIDER_DIR
elsewhere), and let the provider registry project those capabilities across MCP,
CLI, REST, OpenAPI, Palette summaries, generated docs, and plugin metadata.
Provider manifests also carry MCP-native prompt, resource, task, and elicitation
metadata for the registry contract. Scaffolding is the path for creating a new
distributable repo with the same locked-in runtime.
30-second path: install the soma binary -> soma status ->
npx -y @dinglebear/soma mcp from an MCP client -> call the soma MCP tool through
tools/call with {"action":"status"}.
Status: production RMCP runtime. Write-capable provider actions are allowed only when the provider declares them and destructive actions are gated.
Not for: an unauthenticated public gateway, a replacement for upstream service authorization, arbitrary untrusted code execution, or a multi-tenant security boundary by itself.
Contents
- Naming
- Capabilities And Boundaries
- Install
- Quickstart
- Client Configuration
- Runtime Surfaces
- MCP Tool Reference
- CLI Reference
- Configuration
- Authentication
- Safety And Trust Model
- Architecture
- Distribution Contract
- Development
- Verification
- Deployment
- Troubleshooting
- Related Servers
- Documentation
- License
Naming
Soma is the runtime product first and the template/export source second.
Generated projects replace these names during scaffold post-processing, but the
shipped soma command is the source of truth for product behavior.
| Surface | Soma value | Generated-project pattern |
|---|---|---|
| Repository | dinglebear-ai/soma (formerly rmcp-template, then rtemplate-mcp ā both still redirect) | dinglebear-ai/r<service>, or the bare product name; older servers still carry <service>-rmcp names behind redirects |
| Rust crate/package | soma | service-specific crate names |
| Canonical binary | soma | usually r<service> or the product name |
| npm package | @dinglebear/soma | <service>-rmcp |
| MCP tool | soma | usually <service> |
| Env prefix | SOMA_* | generated service prefix |
Capabilities And Boundaries
| Path | Use when | You author | Runtime supplies |
|---|---|---|---|
| Drop-in provider | You can describe a capability as a manifest, script, WASM module, OpenAPI operation, or upstream MCP call. | Files under providers/ with tools, prompts, resources, env needs, capability grants, and surface overlays. | MCP tool dispatch, dynamic CLI commands, direct REST routes, schema validation, auth policy, refresh, OpenAPI/Palette summaries, generated docs, and plugin metadata. |
| Static Rust provider | The capability needs native Rust, tight integration, or reusable crates. | A Rust provider/action registered with the provider registry. | The same MCP/CLI/REST/docs/plugin projection without per-surface rewrites. |
| Scaffolded product | You need a renamed repository, package identity, ports, plugins, Docker labels, and release metadata. | A scaffold_intent payload or cargo xtask scaffold options. | A compiling product repo, scaffold report, cargo-generate post-processing, and scaffold/export verification checks. |
| Custom profile | You need a narrower binary or deployment shape. | Cargo feature selection. | The same runtime crates behind local-adapter, server, and full profiles. |
Batteries Included
- One compact MCP service tool (
soma) withactiondispatch, so agent tool lists stay small even as provider catalogs grow. - One canonical binary:
somawith explicitserve,mcp, and CLI modes for REST API, Streamable HTTP MCP, stdio MCP, optional web UI, and local actions. - Dynamic provider loading from
.json,.ts,.py,.wasm, and.mdfiles, plus native Rust providers and upstream MCP/OpenAPI provider kinds. A structuredproviders/{tools,prompts,resources}/layout is supported alongside root-level files, including path-derived MCP resources (static files and dynamic.tsreaders) with a path-traversal trust boundary. - Provider manifest contracts for tools, prompts, resources, tasks, elicitation forms, env requirements, capability grants, and surface overlays.
- Shared validation, destructive-action confirmation, auth/scope enforcement, response limits, redaction, logging, metrics, generated OpenAPI, generated provider surface docs, plugin manifests, setup, doctor, and release tooling.
Soma owns the runtime projection, validation, auth policy, packaging, generated metadata, and scaffold automation. Provider code owns service-specific behavior and credentials. Upstream services own their own authorization and data model. Soma deliberately refuses to make credentials part of tool-call input and does not turn provider manifests into an unrestricted remote execution boundary.
Install
Use the npm launcher when an MCP client expects an npx command. During
postinstall, the package downloads the matching Linux/x64 or Windows/x64
release archive, verifies its SHA256SUMS entry and GitHub build attestation,
and installs the native binary inside the package. GitHub CLI 2.68 or newer is
required for provenance verification.
npx -y @dinglebear/soma mcp
Use Cargo while developing the repo:
cargo run --bin soma -- mcp
cargo run --bin soma -- serve
Release builds publish GitHub Release binaries, Docker/OCI metadata, the
@dinglebear/soma npm launcher, MCP registry metadata, and plugin package files from
the same release component.
Product Profiles
Choose the amount of surface area you want without changing the provider authoring model.
| Target | Best fit | Default profile | Includes |
|---|---|---|---|
| Local agent adapter | Thin wrapper over dropped providers or an upstream API | local-adapter | CLI + stdio MCP in one local binary. No REST/Web mirror by default. |
| Shared API/MCP server | Service used by multiple clients or a gateway | server | CLI + REST API + Streamable HTTP MCP + stdio MCP + health/status routes + auth-capable runtime. |
| Full application platform | App owns state, jobs, dashboards, workflows, or human UI | full | server plus embedded web UI, OAuth, observability, and plugin support. |
| CLI-only or custom local tool | Scripts, operator utilities, one-machine tools | Custom feature set, usually starting from cli | CLI parser and shared service layer. The stock packaged local binary uses local-adapter, so CLI-only products may prune MCP or adjust binary feature gates. |
Lower-level Cargo features are available when you need a custom shape:
| Feature | Purpose |
|---|---|
cli | CLI shim and command parsing. |
mcp | MCP tool, schema, resource, prompt, and scope layers. |
mcp-stdio | Local stdio MCP transport. |
api | REST handlers and OpenAPI-backed business routes. |
auth | Shared auth policy and bearer-token enforcement. |
oauth | Google, Authelia, and GitHub OAuth/OIDC plus JWT issuance on top of auth. |
mcp-http | Streamable HTTP MCP mounted in Axum. |
web | Embedded static web UI fallback. |
observability | Metrics/tracing hooks. |
plugin | Plugin setup/support helpers. |
local-adapter | Lean local binary: cli + mcp-stdio. |
server | Deployable HTTP runtime profile: cli + api + HTTP MCP + stdio MCP. |
full | Complete platform profile: local adapter, server, web, OAuth, observability, and plugin support. |
Quickstart
Run the product as-is:
git clone https://github.com/dinglebear-ai/soma
cd soma
# Full platform mode: REST API + HTTP MCP + web fallback on :40060
cargo run --bin soma -- serve
# Local binary: stdio MCP
cargo run --bin soma -- mcp
# Local binary: CLI
cargo run --bin soma -- greet --name Alice
Useful smoke checks:
curl http://localhost:40060/health
cargo run --bin soma -- status
cargo run --bin soma -- doctor
Call the MCP endpoint directly:
curl -s -X POST http://localhost:40060/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"soma","arguments":{"action":"greet","name":"Alice"}}}'
Drop In A Provider
The fastest path for a new server is provider-first. Add a provider manifest or
module to providers/, then run the same binary. Use SOMA_PROVIDER_DIR
when the provider catalog should live outside the working directory.
mkdir -p providers
cat > providers/hello-local.json <<'JSON'
{
"schema_version": 1,
"provider": {
"name": "hello-local",
"kind": "static-rust",
"title": "Hello Local"
},
"tools": [
{
"name": "hello_local",
"description": "Return a deterministic hello payload from a dropped provider.",
"input_schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": { "type": "string" }
}
},
"cli": {
"enabled": true,
"command": "hello-local"
},
"rest": {
"enabled": true,
"method": "POST",
"path": "/v1/hello-local"
},
"meta": {
"result": {
"message": "hello from a dropped provider"
}
}
}
]
}
JSON
Call it through the dynamic CLI surface:
cargo run --bin soma -- hello-local --name Alice
Run the server and call the same provider over REST and MCP:
cargo run --bin soma -- serve
curl -s -X POST http://localhost:40060/v1/hello-local \
-H "Content-Type: application/json" \
-d '{"name":"Alice"}'
curl -s -X POST http://localhost:40060/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"soma","arguments":{"action":"hello_local","name":"Alice"}}}'
Plain Python functions can also be dropped directly into providers/:
PROVIDER = {"name": "math-tools", "kind": "python"}
def add(a: int, b: int) -> int:
"""Add two integers."""
return a + b
When TOOLS is absent, public functions defined in the module become tools.
Sync and async functions are supported, and common Python type annotations are
converted into input schemas.
Python provider files are trusted code. Soma imports them during provider catalog refresh to discover tools, then executes tool calls in a sidecar with a cleared environment plus only declared provider/tool env values. Catalog import does not receive provider env; read secrets inside tool functions, not at module import time.
Provider manifests can declare:
- tools/actions exposed through MCP by default and through CLI/REST when their overlays opt in
- MCP-native prompt, resource, task, and elicitation metadata for the provider registry contract
- required environment variables and redaction rules
- filesystem, network, browser, terminal, GitHub, and env capability grants
- limits, destructive-action metadata, examples, generated docs, plugin, and UI metadata
Supported provider kinds are static-rust, openapi, ai-sdk, wasm, mcp,
python, langchain, and llamaindex. See
docs/specs/dynamic-provider-runtime.md,
docs/contracts/provider-manifest.schema.json,
and docs/generated/provider-surfaces.md.
Scaffold A New Project
Use cargo xtask scaffold when the provider-first path needs to become a new
repository with its own crate names, binary names, ports, plugin package,
Docker metadata, release metadata, and docs. It can plan without touching files,
generate with cargo-generate plus the Rust post-processor, write
docs/scaffold-report.md, and verify the generated export shape.
Plan from a short service name:
cargo xtask scaffold --name myservice --category upstream-client --port auto --plan
Plan from MCP scaffold_intent JSON:
cargo xtask scaffold --intent scaffold-intent.json --plan
Generate into an output parent directory:
cargo xtask scaffold --intent scaffold-intent.json --apply ../generated
Verify an existing generated project:
cargo xtask scaffold --verify ../generated/myservice-mcp
Print a path-aware follow-up plan for adapting the generated stub:
cargo xtask scaffold --adapt-plan ../generated/myservice-mcp
Materialize starter artifacts from an action manifest:
cargo xtask scaffold \
--write-action-starters ../generated/myservice-mcp \
--actions actions.json
Add starter action snippets:
cargo xtask scaffold \
--intent scaffold-intent.json \
--actions actions.json \
--plan
Example action manifest:
{
"actions": [
{
"name": "list_things",
"description": "List visible things.",
"scope": "read",
"params": [
{ "name": "kind", "type": "string", "required": false }
]
}
]
}
Use:
--category upstream-clientfor a lean local adapter around an existing API.--category application-platformfor API + CLI + MCP + web defaults.--no-cargo-checkonly when you need fast static verification while iterating.
See docs/SCAFFOLD.md, docs/CARGO_GENERATE.md, and docs/contracts/scaffold-intent.schema.json for the full scaffold contract.
Architecture
The runtime keeps product behavior behind the provider registry. Every external surface is a thin parser/formatter around the same provider snapshot and service runtime, so dropping a provider does not require hand-editing MCP, CLI, REST, OpenAPI, plugin, or docs code.
ProviderRegistry
crates/soma/application/src/provider_registry.rs
Validates provider manifests, computes snapshots/fingerprints, indexes tools,
prompts, resources, CLI commands, REST routes, and MCP primitives.
Provider sources
crates/soma/application/src/providers/
Static Rust, file-backed JSON manifests, TypeScript AI SDK sidecars, Python
LangChain/LlamaIndex sidecars, WASM, OpenAPI-backed providers, and upstream
MCP providers.
SomaService
crates/soma/application/src/service.rs
Built-in product/service logic used by the static Rust provider.
Transport shims
crates/soma/cli/src/lib.rs CLI parser and output formatting.
crates/soma/mcp/src/tools.rs MCP JSON args to service calls.
crates/soma/api/src/api.rs REST extractors to service calls.
apps/soma/src/http.rs Axum router, auth, MCP, API, web fallback.
Built-in action metadata
crates/soma/domain/src/actions.rs
Native action metadata, validation, cached catalog/help, and native dispatch.
The thin-shim rule is strict:
- Parse input at the surface.
- Call the provider registry or service runtime.
- Return or print the result.
Do not put business rules in CLI, MCP, REST handlers, or the binary entrypoint
(apps/soma/src/bin/soma.rs / apps/soma/src/bootstrap.rs).
Runtime Surfaces
The canonical binary can run the whole app from one executable:
soma serve # HTTP server: REST API + Streamable HTTP MCP + web fallback
soma mcp # stdio MCP transport
soma status # CLI command through the same binary
Local adapter mode is optimized for plugin/local use:
soma mcp # stdio MCP transport
soma greet --name Alice # CLI command
soma doctor # operator pre-flight checks
soma watch # poll /health and emit state changes
soma setup check # plugin/appdata setup checks
Every explicit runtime mode loads the provider registry. File providers default
to ./providers and can be moved with SOMA_PROVIDER_DIR. CLI startup, MCP
dispatch, and dynamic REST routes refresh file providers before execution, then
enforce the active provider snapshot's schema, surface, scope, capability,
destructive-action, and response-limit rules.
HTTP routes in the server profile:
| Route | Purpose |
|---|---|
/mcp | Streamable HTTP MCP transport. |
/health | Unauthenticated liveness. |
/readyz | Readiness check. |
/status | Public redacted runtime status. |
/openapi.json | Generated REST OpenAPI schema. |
/metrics | Prometheus metrics when built with observability. |
/v1/capabilities | REST route inventory. |
/v1/greet, /v1/echo, /v1/status, /v1/help | Direct REST business routes. |
/v1/tools/{action} | Generic REST execution route for dropped provider tools. |
/v1/{provider-route} | Optional provider-declared REST route when a tool supplies a custom REST overlay. |
/mcp/.well-known/* | OAuth metadata when OAuth is enabled. |
/* | Embedded web UI fallback when built with web. |
REST is direct-route-only: there is no /v1/soma action envelope. MCP remains one soma tool with an action argument.
MCP Tool Reference
The runtime exposes one compact MCP tool, soma, with an action argument.
Built-in actions and dropped provider tools share that same dispatch path. This
keeps MCP discovery small while allowing the provider catalog to grow behind the
single tool.
| Action | Scope | Cost | Transport | REST route | CLI | Parameters | Description |
|---|---|---|---|---|---|---|---|
greet | soma:read | cheap | MCP + CLI + REST | POST /v1/greet | soma greet [--name NAME] | name (optional string) | Return a greeting. |
echo | soma:read | cheap | MCP + CLI + REST | POST /v1/echo | soma echo --message MSG | message (required string) | Echo a message back unchanged. |
status | soma:read | cheap | MCP + CLI + REST | GET /v1/status | soma status | none | Return server status and configuration info. |
python_environment_status | soma:write | cheap | MCP + CLI + REST | GET /v1/python/environments | soma python_environment_status | none | Inspect immutable Python environment cache state without executing provider code. |
python_environment_prune_plan | soma:write | moderate | MCP + CLI + REST | POST /v1/python/environments/prune-plan | soma python_environment_prune_plan --json '{\ | stale_before_unix_seconds (required integer), max_entries (optional integer) | Plan a bounded prune of stale non-ready Python environment cache entries. |
python_environment_prune | soma:write | write |
Sourced from the repository README.
More in Browser & Web
- browser-useControl a real Chrome browser to complete any task: fill forms, extract data, book flights.110,346
- Puppeteer MCP ServerEnables headless browser automation for scraping dynamic JS pages, taking full-page screenshots, clicking elements, and filling web forms.9,800
- strataMCP server for progressive tool usage at any scale (see https://klavis.ai)5,794
- exaFast, intelligent web search and web crawling. New mcp tool: Exa-code is a context tool for coding 4,920
- apify-mcp-serverExtract data from any website with thousands of scrapers, crawlers, and automations on Apify Store ā”4,798
- browserbasehq-mcp-browserbaseProvides cloud browser automation capabilities using Stagehand and Browserbase, enabling LLMs to iā¦3,409