Skip to main content

yunohost-mcp

Secure MCP server for YunoHost: Nostr-authenticated, policy-controlled, auditable administration, diagnostics, and _ynh package development for AI clients (Codex, Claude, OpenCode, ChatGPT-compatible MCP clients).

See PLAN.md for the full design and phased roadmap, and PHASE0_INVESTIGATION.md for how it maps onto YunoHost's actual Python API.

Running the server

yunohost-mcp --transport stdio   # local development, fully trusted (no NIP-98 handshake)
yunohost-mcp --transport http --host 127.0.0.1 --port 8765   # NIP-98-authenticated, remote-capable

By default fake_yunohost is off (real mode) — set YUNOHOST_MCP_FAKE_YUNOHOST=true to run against canned data on a machine without YunoHost installed. See identity.example.toml for identity.toml's shape (pubkey → role mapping; required before any HTTP request can do anything).

Installing the client tools

Once published, install the Python package with:

python3 -m pip install yunohost-mcp-connect

This installs yunohost-mcp, yunohost-mcp-connect, and yunohost-mcp-delegate. For an isolated command-line installation, use:

uv tool install yunohost-mcp-connect

Connecting a client: yunohost-mcp-connect

Mainstream MCP clients (Claude Desktop, a plain Codex install, etc.) have no way to sign a NIP-98 Authorization header — that's specific to this server. yunohost-mcp-connect bridges the gap: a small local process that speaks plain MCP over stdio to your actual client, and forwards every request to the remote --transport http server, signed with your own Nostr key.

yunohost-mcp-connect --remote-url https://your-yunohost-domain/mcp --key-file ~/.config/yunohost-mcp/key
  • --key-file (or $YUNOHOST_MCP_CLIENT_KEY_FILE) points at a file holding a hex or nsec1... private key — preferred over --key/$YUNOHOST_MCP_CLIENT_KEY, which put the key in argv/environment where other processes on the same machine can read it.
  • --delegation-file (or $YUNOHOST_MCP_CLIENT_DELEGATION_FILE) presents a delegation event (PLAN.md Phase 11) alongside your own signature, for a disposable agent identity an owner granted a subset of their access to.
  • Point your MCP client's config at this command (not the server directly) — tools/list, tools/call, resources/list, and resources/read are all forwarded verbatim; every other MCP feature and all authorization/policy/audit still happens exactly as it would if you'd signed the request yourself, because you did.

Connecting Claude Desktop or Codex

Both point at yunohost-mcp-connect, not at the server directly — the bridge is what signs each request with your Nostr key. Use the full path to yunohost-mcp-connect in whatever environment you installed yunohost-mcp into (e.g. ~/.local/pipx/venvs/yunohost-mcp/bin/yunohost-mcp-connect, or a venv's bin/ directory — which yunohost-mcp-connect after activating it will tell you).

Claude Desktop (claude_desktop_config.json — Settings → Developer → Edit Config):

{
  "mcpServers": {
    "yunohost-mcp": {
      "command": "/full/path/to/yunohost-mcp-connect",
      "env": {
        "YUNOHOST_MCP_CLIENT_REMOTE_URL": "https://your-yunohost-domain/mcp",
        "YUNOHOST_MCP_CLIENT_KEY_FILE": "/home/you/.config/yunohost-mcp/key"
      }
    }
  }
}

Codex CLI (~/.codex/config.toml):

[mcp_servers.yunohost-mcp]
command = "/full/path/to/yunohost-mcp-connect"

[mcp_servers.yunohost-mcp.env]
YUNOHOST_MCP_CLIENT_REMOTE_URL = "https://your-yunohost-domain/mcp"
YUNOHOST_MCP_CLIENT_KEY_FILE = "/home/you/.config/yunohost-mcp/key"

For a delegated (disposable) identity instead of your own key, add YUNOHOST_MCP_CLIENT_DELEGATION_FILE pointing at the file yunohost-mcp-delegate produced (see below). Restart the client after editing its config — both read this file once, at startup.

Granting a disposable agent identity access: yunohost-mcp-delegate

An identity.toml entry grants access to one specific pubkey, permanently (until edited). A delegation (PLAN.md Phase 11) is the other way to grant access: an owner signs a short-lived, scoped grant to an agent's own disposable key, without ever adding that key to identity.toml or handing over any private key. yunohost-mcp-delegate is what an owner runs to create one:

yunohost-mcp-delegate --key-file ~/.config/yunohost-mcp/key \
  --delegate npub1... \
  --remote-url https://your-yunohost-domain/mcp \
  --role readonly --ttl 24h \
  --out agent-delegation.json
  • --delegate is the agent's own pubkey (it must sign its own NIP-98 requests as always — a delegation never replaces that, it only adds standing).
  • --remote-url fetches the server's pubkey and this owner's own current scopes automatically — no need to type the server's pubkey by hand, and an over-broad --scope/--role request is flagged (the server can never grant more than the delegator's own current scopes; see auth/delegation.py). Pass --server instead if you'd rather supply the server's pubkey directly.
  • --scope/--role (repeatable, combinable) choose what to grant; --ttl (e.g. 24h, 7d) how long — the server rejects anything over 30 days.
  • The output is a signed delegation event: a bearer credential once issued. Hand the file to the agent to use with yunohost-mcp-connect --delegation-file agent-delegation.json, over a channel you trust (the same as you'd hand over an API key).
  • To take a delegation back before it expires, add its id (printed after signing) to revoked_delegations.toml — this is independent of, and finer-grained than, removing the delegator's own identity.toml entry (which revokes every delegation they've ever issued).

Development

uv sync --group dev
uv run pytest -q

Creating a release tag

Maintainers can run the GitHub Actions Tag release workflow manually from the branch or commit to release, providing a version without the v prefix (for example, 0.1.1). It validates the version, refuses to overwrite an existing tag, runs the full CI checks on Python 3.11 and 3.12, and only then pushes an annotated v<version> tag.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yunohost_mcp_connect-0.1.10.tar.gz (163.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yunohost_mcp_connect-0.1.10-py3-none-any.whl (83.1 kB view details)

Uploaded Python 3

File details

Details for the file yunohost_mcp_connect-0.1.10.tar.gz.

File metadata

  • Download URL: yunohost_mcp_connect-0.1.10.tar.gz
  • Upload date:
  • Size: 163.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for yunohost_mcp_connect-0.1.10.tar.gz
Algorithm Hash digest
SHA256 77a86417d1af60f86482370b1036be38a823acb33c7f9297762fac6d3310cf0c
MD5 869269952051763e7a4a522e4910ffd3
BLAKE2b-256 8738fe1d601d9b15d883fa64178181e5d47151f06a5041e0b150adc2513e84cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for yunohost_mcp_connect-0.1.10.tar.gz:

Publisher: publish-pypi.yml on imattau/yunohost-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yunohost_mcp_connect-0.1.10-py3-none-any.whl.

File metadata

File hashes

Hashes for yunohost_mcp_connect-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 938a948542d619184fb48d2d3f9f0820845b2e571584afd6f17a03ccd8429e73
MD5 dda6ddb65a083e491b307707306f5ded
BLAKE2b-256 78ad786dca769ccc1a54c1b7bea1a8596704d3666903c6e9425c74fb6731d615

See more details on using hashes here.

Provenance

The following attestation bundles were made for yunohost_mcp_connect-0.1.10-py3-none-any.whl:

Publisher: publish-pypi.yml on imattau/yunohost-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.8.34

2 files

0.8.33

2 files

0.8.32

2 files

0.8.31

2 files

0.8.30

2 files

0.8.29

2 files

0.8.28

2 files

0.8.27

2 files

0.8.26

2 files

0.8.25

2 files

0.8.24

2 files

0.8.23

2 files

0.8.21

2 files

0.8.20

2 files

0.8.19

2 files

0.8.5

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.13

2 files

0.7.12

2 files

0.7.11

2 files

0.7.10

2 files

0.7.9

1 file

0.7.8

2 files

0.7.7

2 files

0.7.6

2 files

0.7.5

2 files

0.7.4

2 files

0.7.3

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.22

2 files

0.1.21

2 files

0.1.20

2 files

0.1.18

2 files

0.1.17

2 files

0.1.16

2 files

0.1.15

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

This release

0.1.10 This release

2 files

0.1.9

2 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