mojo-kernels
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mojo-kernelscalculate the dot product of [1, 2, 3] and [4, 5, 6]"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Mojo MCP
FastMCP (Python) → Python extension bindings → native Mojo 1.0 CPU kernels.
Run
Requires Linux/macOS supported by Mojo and Python 3.12 or 3.13. uv installs
Mojo 1.0.0 along with the Python dependencies; no separate compiler setup is needed.
uv sync
uv run mojo-mcpThe default transport is stdio: an MCP client launches this process and exchanges
JSON-RPC on stdin/stdout. It is not an interactive shell. Logs go to stderr.
The first startup compiles _kernels.mojo into a cached shared library through
mojo.importer. Subsequent startups reuse it; source changes trigger recompilation.
Allow extra time for first startup, or prewarm with:
uv run python -c 'from mojo_mcp.server import mcp'The package directory must be writable for __mojocache__. This project ships
Mojo source rather than a platform-specific precompiled binary.
Related MCP server: mcp_calculator
MCP client configuration
Replace the project path and use an absolute uv executable path if your client
cannot find it on PATH:
{
"mcpServers": {
"mojo-kernels": {
"command": "uv",
"args": ["run", "--directory", "/absolute/path/to/mojo-mcp", "mojo-mcp"]
}
}
}Pi feedback loop
This checkout is registered as mojo-kernels in ~/.pi/agent/mcp.json with
directTools: true, using an absolute uv path and this project's directory.
Run
/reloadin Pi after changing its MCP configuration.Run
/mcp reconnect mojo-kernelsto populate/refresh tool metadata. If direct tools are not visible yet, run/reloadagain after the connection succeeds.Ask the agent to call
kernel_info,dot_product, oraxpyonmojo-kernels.After editing Python or Mojo code, run
/mcp reconnect mojo-kernelsto restart the process; the Mojo importer recompiles changed source automatically. If tool names or schemas changed, follow with/reload.
The adapter's proxy also supports discovery via mcp({server: "mojo-kernels"}).
Tools
dot_product(x, y)→{ "value": 32.0 }for[1,2,3]and[4,5,6].axpy(alpha, x, y)→{ "values": [6.0,9.0,12.0] }for alpha2and those vectors.kernel_info()→ backend, precision, and input limit.
Vectors must have equal lengths, contain finite numbers, and have at most 10,000 elements. Empty inputs return zero/an empty vector. Non-finite outputs (including floating-point overflow) are reported as tool errors, not invalid JSON values.
Streaming telemetry server
uv run mojo-telemetryOpen http://127.0.0.1:8766 and click Start demo. FastAPI accepts batches; a persistent Mojo ring buffer maintains rolling statistics and detects spikes; WebSockets stream summaries to a live chart. The MCP server is unchanged.
See docs/telemetry.md for the ingestion API, architecture,
limits, and lifecycle commands. Local, single-process, in-memory prototype.
Network behavior simulator
uv run mojo-networkOpen http://127.0.0.1:8767 to experiment with bandwidth, latency, packet loss, queue capacity, timeouts, and retry backoff. Compare retries against a no-retry baseline and export the results. Mojo runs the discrete-event model; Python serves the dashboard. No real network traffic is generated by the simulation.
See docs/network.md for model assumptions, API, and limits.
Explore Mojo without MCP
playground/ contains three creative standalone programs:
a ray-traced alien planet, a retro music synthesizer, and a procedural cave world.
The seven introductory examples live in playground/fundamentals/.
No server changes or additional packages needed.
Development
uv run pytest
uv run ruff check .
uv run ruff format --check .tests/ exercises actual compiled kernels, MCP calls, validation, and a real
stdio subprocess. No mock or Python fallback implements the arithmetic.
Add your own kernel
Add native computation to
src/mojo_mcp/_kernels.mojo. Keep Python object conversion at the binding boundary, outside hot loops.Wrap it in a function taking/returning
PythonObjectand register it withmodule.def_function[...]inPyInit__kernels.Add a typed
@mcp.toolfunction insrc/mojo_mcp/server.pywith input limits and JSON-safe output validation. Call the extension with positional arguments.Add native and MCP tests, then restart the server to compile your changes.
Scope and performance
Mojo 1.0 supports this architecture, but its Python extension bindings are still marked beta upstream. This starter uses the official importer and bindings, not ctypes, subprocess-per-call, arbitrary code execution, or a CLI JSON bridge.
These are simple Float64 CPU kernels, not GPU kernels. They copy Python lists into native Mojo lists and copy results back. MCP JSON serialization, conversion, and Python's GIL can dominate small operations; this is not a claim of speedup over NumPy. Benchmark your real workload before adding SIMD, GPU execution, or buffer-based zero-copy input. The server is local stdio only; remote deployment would need authentication, transport/resource limits, and operational hardening.
References: Mojo Python bindings, FastMCP.
This server cannot be deployed
Maintenance
Related MCP Connectors
This MCP server enables users to perform scientific computations regarding linear algebra and vect…
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
QuLab MCP remote server (Streamable HTTP) for computational science and lab tools.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables running MCP tools against local MLX models on your Mac, with hardware-aware configuration, CLI streaming, and a dashboard for routing and monitoring.2,456 npm-
- AlicenseAqualityDmaintenanceA stdio MCP server that gives LLMs a safe scientific calculator with infix math, complex numbers, matrices, statistics, unit conversions, and more via tools that return JSON.331MIT
- AlicenseAqualityAmaintenanceZero-dependency stdio bridge to Moltline Studio's fleet of 14 hosted MCP servers covering code review, time operations, data transforms, business ops, education, research, outreach and more. Free tier requires no registration; premium tools unlock with a license. Independently audited, MCPize Verified A.10MIT
- AlicenseNot gradedqualityCmaintenanceEnables any Model Context Protocol-compatible host (Claude Desktop, Cherry Studio, Cline, MCP Inspector) to call 8 plug-and-play tools over stdio: hotspot ranking, TC3 signing, text chunking, date calculation, read-only SQLite queries, webpage text extraction, JWT decode/verify, and health checks.23 npmMIT