Skip to main content

nodus-mcp

Model Context Protocol (MCP) library for Nodus — bidirectional client and server, implementing the 2026-07-28 RC specification.

Status: v0.1.0 — published on PyPI.


Authentication warning

v0.1 does not support OAuth 2.0. Only bearer-token authentication is implemented. Servers that require OAuth 2.0 / OIDC authentication (including many production MCP deployments) cannot be used with nodus-mcp v0.1. OAuth support is planned for v0.2.

To connect to a server with a bearer token:

from nodus_mcp import HttpTransport, McpClient

client = McpClient()
transport = HttpTransport("https://server/mcp", bearer_token="sk-...")
conn = client.connect(transport, alias="srv")

Installation

pip install nodus-mcp

# Development install (both repos checked out):
pip install -e . --no-deps
# Set PYTHONPATH to nodus-lang source:
# PYTHONPATH="path/to/nodus-lang/src" python ...

Quick start

Run an MCP server

# Spawned-child stdio mode (parent process connects to our stdin/stdout)
nodus-mcp serve --stdio

# HTTP mode
nodus-mcp serve --http --port 8080 --bearer-token my-api-key

To expose tools, use the Python API before serving:

from nodus_mcp import McpServer, HttpServerTransport

server = McpServer()
server.set_resource_list_handler(lambda: [
    {"uri": "file:///data", "name": "Data Directory"}
])

transport = HttpServerTransport("localhost", 8080)
transport.serve(server.dispatch)

Connect to a server

nodus-mcp connect http://localhost:8080 --bearer-token my-api-key

Interactive REPL:

Connected. Server: my-server 1.0. Tools: 3. Type 'help' for commands.
mcp> list
  my.tool — Does something useful
mcp> call my.tool {"x": 42}
{"content": [{"type": "text", "text": "done"}]}
mcp> quit

Use from a Nodus script

import "nodus-mcp"

// Discover and call tools (requires McpClient.connect() in host Python code)
let result = tool.invoke("mcp.srv.my_tool", {x: 42})

Serve a ToolRegistry over the official SDK (nodus_mcp_aindy)

NodusServer wraps the mcp SDK (1.x or 2.x; install it yourself) and has three transports: stdio, SSE (run_sse_app()), and streamable HTTP, the one ChatGPT and claude.ai use for remote servers:

import uvicorn
from nodus_mcp_aindy import NodusServer

server = NodusServer(registry, auth_hook=check)   # check(name, args, context)
app = server.streamable_http_app(                  # MCP endpoint at /mcp
    routes=[...],       # your own routes, e.g. an OAuth authorization server
    middleware=[...],   # e.g. a bearer check; scope["user"/"auth"] reach context
)
uvicorn.run(app, host="127.0.0.1", port=8000)

Add your routes through routes=, and do not Mount the app inside another. Starlette does not run a mounted app's lifespan, so the SDK session manager would never start. Stateless by default. Pass security_settings= to turn on the SDK's Host/Origin checking: with None it is off on both SDK majors. For a quick script, use server.run(transport="streamable-http", port=8000). On a loopback bind, that turns the checking on for loopback names by default.


Entry-point contract

# nodus-mcp registers itself in the nodus.nd entry-point group:
# nodus-mcp = "nodus_mcp.nd:get_nd_root"
#
# After pip install nodus-mcp, any Nodus script can:
#   import "nodus-mcp"
# and get the adapter module without additional configuration.
# See docs/guide/library-entry-points.md in nodus-lang for the contract.

Deprecated features (Roots + Sampling)

nodus-mcp v0.1 includes Roots and Sampling despite their deprecation in the 2026-07-28 RC, because existing MCP servers in the ecosystem use them (real interop need) and the RC's 12-month deprecation window extends to at least 2027-07-28.

Do not remove Roots or Sampling before:

  1. The protocol has actually removed them, AND
  2. nodus-mcp has shipped a replacement

The removal gate is 2027-07-28 at the earliest. See docs/governance/TECH_DEBT.md (TD-001, TD-002) and docs/design/05-deprecated-features.md §C1.


Known limitations

Limitation Details
No OAuth support Bearer token only; see auth warning above
resources/subscribe not implemented Server-push deferred to v0.2
Server-initiated requests (HTTP) roots/list, sampling/createMessage, elicitation/create are stdio-only; HTTP has no push channel (TD-007)
Partial JSON Schema validation _validate_args checks required fields and primitive types; enum, pattern, minLength etc. are not enforced server-side (TD-008)
Resource handler KeyError convention Resource read handlers must raise KeyError(uri) for unknown URIs (TD-009)
requestState is on the wire Server-issued elicitation state travels to the client; never checkpoint secrets (TD-010)

Spec target

2026-07-28 RC — stateless (no session initialization handshake, no Mcp-Session-Id). Capabilities travel in _meta per-request. server/discover replaces capability exchange.

Metadata

Release files for nodus-mcp 0.1.6

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

Source distribution (sdist)

Source distribution for nodus-mcp 0.1.6
File Size Uploaded Provenance Actions
nodus_mcp-0.1.6.tar.gz 108.6 kB Without provenance Details for nodus_mcp-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nodus-mcp 0.1.6
File Interpreter ABI Platform Actions
nodus_mcp-0.1.6-py3-none-any.whl Python 3 none any Details for nodus_mcp-0.1.6-py3-none-any.whl

Total release size: 169.8 kB

Release files / nodus_mcp-0.1.6.tar.gz

Download URL nodus_mcp-0.1.6.tar.gz
Size 108.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6179775e80497218fe11ea9c924323ce51de342ec28ed3d2fa61b95d571dcea7
BLAKE2b-256 checksum
How to use checksums
0e626caea3f4468613d3784cf97bf4cea43d0f6f4f662e14c278b6434737727c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / nodus_mcp-0.1.6-py3-none-any.whl

Download URL nodus_mcp-0.1.6-py3-none-any.whl
Size 61.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf9e275926627bbf3a1f68dd45e17f9c08344f76759160a9adf51f4f8969d0a6
BLAKE2b-256 checksum
How to use checksums
9adf127754a2e2d7ef071e1f575e9fec84e3ec5be00404503157611e35b45270
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Security for nodus-mcp 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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