About
MCP ToolMap + WASIX/WASI executor bridge
README
Executor and component tooling for the Greentic platform targeting the
wasix:mcp interface. The workspace currently provides a reusable Rust
library (greentic-mcp-exec) that can load Wasm components, verify their provenance,
wire in the Greentic host imports, and execute the exported MCP entrypoint.
Workspace layout
greentic-mcp/
├─ crates/
│ ├─ mcp-adapter/ # MCP adapter component template (wasix:[email protected])
│ └─ mcp-exec/ # executor library (package: greentic-mcp-exec)
└─ Cargo.toml # workspace manifest
greentic-mcp-exec
Public API:
use greentic_types::{EnvId, TenantCtx, TenantId};
use greentic_mcp_exec::{ExecConfig, ExecRequest, RuntimePolicy, ToolStore, VerifyPolicy};
use serde_json::json;
use std::path::PathBuf;
let tenant = TenantCtx {
env: EnvId("dev".into()),
tenant: TenantId("acme".into()),
team: None,
user: None,
trace_id: Some("trace-123".into()),
correlation_id: None,
deadline: None,
attempt: 0,
idempotency_key: None,
};
let cfg = ExecConfig {
store: ToolStore::LocalDir(PathBuf::from("./tools")),
security: VerifyPolicy::default(),
runtime: RuntimePolicy::default(),
http_enabled: false,
secrets_store: None,
};
let result = greentic_mcp_exec::exec(
ExecRequest {
component: "weather_api".into(),
action: "forecast_weather".into(),
args: json!({"location": "AMS"}),
tenant: Some(tenant),
},
&cfg,
)?;
Key features:
- Resolver – Reads Wasm bytes from local directories or single-file HTTP sources (with caching).
- Verifier – Checks digest/signature policy before execution.
- Describe bridge – Calls the
greentic:component/[email protected]describe world when tools implement it, surfacing schema/default metadata directly from each component. - Runner – Spins up a Wasmtime component environment, registers the
runner-host-v1imports fromgreentic-interfaces, and calls the tool's MCPexecexport. - Errors – Structured error types map resolution, verification, and runtime failures to caller-friendly variants.
mcp-adapter
Guest component template that:
- Exports
greentic:component/[email protected]and importswasix:[email protected]. - Accepts JSON payloads of
{operation?, tool?, arguments?}:- Defaults to
listwhen no tool is provided; defaults tocallwhen a tool is present. - Maps
list→list-tools,call→call-tool(tool, arguments). - Supports shorthand tool calls where runtime
operationis a tool id (for exampleget_weather) and payload is passed as arguments.
- Defaults to
- Returns
{ok: true, result: ...}envelopes with content/structured-content/meta and lightweight cards/messages for text/image/audio/resource(-link) blocks; elicitations surface as{ok: true, elicitation: ...}. - Errors use
{ok: false, error { code, message, status, tool, protocol, details }}with codesMCP_TOOL_ERROR,MCP_ROUTER_ERROR, orMCP_CONFIG_ERROR. - Designed to be composed at pack-build time with a router component; the final merged artifact is the component flows should reference.
- See
crates/mcp-adapter/README.mdfor the detailed payload/response contract and composition notes.
greentic-types
Pulled from crates.io; provides TenantCtx, identifiers, and supporting types for multi-tenant flows.
Schema ownership
MCP node configuration schemas ship with the Wasm component that implements the tool. Each component is responsible for returning a describe-json payload (matching greentic:[email protected]) that includes its schema/defaults. This repository only bridges the runtime protocol and does not try to duplicate per-tool JSON schemas.
Development
rustup target add wasm32-wasip2
cargo fmt
cargo clippy --all-targets -- -D warnings
cargo test
RUN_ONLINE_TESTS=1 cargo test -p greentic-mcp-exec --test online_weather
The online weather integration test is skipped unless RUN_ONLINE_TESTS=1 is set.
For faster local MCP runs, prefer the release build and enable the Wasmtime cache:
cargo run -p greentic-mcp-exec --release -- router --router /path/to/component.wasm --list-tools
cat > /tmp/wasmtime-cache.toml <<'EOF'
[cache]
enabled = true
directory = "/tmp/wasmtime-cache"
EOF
WASMTIME_CACHE_CONFIG=/tmp/wasmtime-cache.toml \
cargo run -p greentic-mcp-exec --release -- router --router /path/to/component.wasm --list-tools
Local checks
Run ci/local_check.sh before pushing to mirror the CI matrix locally. Helpful
toggles:
LOCAL_CHECK_ONLINE=1– enable the networked weather test.LOCAL_CHECK_STRICT=1– treat skipped optional steps/tools as failures.LOCAL_CHECK_VERBOSE=1– echo each command.
The script will install a lightweight pre-push hook (if one is not already
present) so future pushes automatically run the same checks.
Protocol revisions
The client-side protocol helpers understand multiple MCP protocol revisions.
ProtocolRevision defaults to 2025-06-18; configs may optionally set
protocol_revision (e.g., "2025-03-26") per server. When unspecified, the
latest revision is used while keeping message shapes compatible with older
servers.
Structured tool output is carried through as-is: outputSchema is preserved on
tools, and tool call results may include structuredContent alongside plain
content for richer responses.
Design note: MCP transport (HTTP/JSON-RPC, protocol headers, batching, OAuth token injection) is handled in other Greentic components. This crate only models MCP message shapes and executes tools locally via WIT/wasm host calls.
Releases & Publishing
- Versions are taken directly from each crate's
Cargo.toml. - When a commit lands on
master, any crate whose manifest version changed gets a Git tag<crate>-v<version>pushed automatically. - The publish workflow then runs, linting and testing before calling
katyo/publish-crates@v2to publish updated crates to crates.io. - Publishing is idempotent; if the specified version already exists, the workflow exits successfully without pushing anything new.
MCP adapter publishing
- greentic-mcp builds and publishes the MCP adapter for
wasix:[email protected]to GHCR:ghcr.io/greenticai/greentic-mcp-adapter:25.06.18-v<adapter_version>ghcr.io/greenticai/greentic-mcp-adapter:25.06.18-stable(moving pointer)
- The pushed artifact is
mcp_adapter_25_06_18.component.wasm, implementinggreentic:component/[email protected]and importingwasix:[email protected]. - See
.github/workflows/publish-mcp-adapter.ymlandscripts/build_adapter.shfor the build/publish steps.
Roadmap
- Implement OCI and Warg resolvers, including signature verification.
- Publish spec docs and add end-to-end examples powered by real tool WASMs.
License
Dual-licensed under either MIT or Apache-2.0. See LICENSE-MIT and
LICENSE-APACHE once added to the repository.
Installing Greentic
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/greenticai/greentic-mcpFAQ
Is Greentic MCP free?
Yes, Greentic MCP is free — one-click install via Unyly at no cost.
Does Greentic need an API key?
No, Greentic runs without API keys or environment variables.
Is Greentic hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Greentic in Claude Desktop, Claude Code or Cursor?
Open Greentic on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
GitHub
PRs, issues, code search, CI status
by GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
by mcpdotdirectAmap Maps Mcp Server
MCP server for using the AMap Maps API
by duxiaohuiSupabase
Database, auth and storage
by SupabaseEverything
Reference / test server with prompts, resources, and tools.
Git
Tools to read, search, and manipulate Git repositories.
Sequential Thinking
Dynamic and reflective problem-solving through thought sequences.
Time
Time and timezone conversion capabilities.
Compare Greentic with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All development MCPs
