MCP stdio adapter for KomAInu: exposes tools via your hosted KomAInu API.
Project description
komainu-mcp
Thin stdio MCP server for KomAInu: it speaks MCP to your editor and calls your hosted KomAInu HTTP API only. It does not connect to any database.
Prerequisites
- uv installed (recommended), or another Python 3.11+ environment.
- A running KomAInu API with
/tools/*routes and (after migration) themcp_access_tokentable.
Authentication
GET /tools/* requires Authorization: Bearer <token> where <token> is either:
- KomAInu MCP token — prefix
kmcp_…, created from the web app (MCP page → Add to Cursor, orPOST /mcp/tokens/POST /mcp/tokens/cursor-installwith your normal Supabase session JWT). Only a hash is stored server-side; you cannot impersonate another user by editing a UUID in config. - Supabase access JWT — same token the web app uses for API calls (short-lived; refresh as your session renews).
Environment variables
| Variable | Required | Description |
|---|---|---|
KOMAINU_API_BASE_URL |
Yes | Base URL of the KomAInu API, e.g. https://your-service.up.railway.app (no trailing slash). |
KOMAINU_ACCESS_TOKEN |
Yes | MCP token (kmcp_…) or Supabase access JWT, sent as Authorization: Bearer …. |
KOMAINU_TESTS_ROOT |
For sync tools | Local root directory containing test files. Sync tool paths can be absolute or relative to this folder. |
Local development against a machine-run API:
export KOMAINU_API_BASE_URL=http://127.0.0.1:8000
export KOMAINU_ACCESS_TOKEN=kmcp_your_secret_from_web_or_curl
export KOMAINU_TESTS_ROOT=/absolute/path/to/your/tests
Cursor
Paste into your MCP config (e.g. Cursor Settings → MCP):
{
"mcpServers": {
"komainu": {
"command": "uvx",
"args": ["komainu-mcp@1.1.0"],
"env": {
"KOMAINU_API_BASE_URL": "https://YOUR-RAILWAY-URL",
"KOMAINU_ACCESS_TOKEN": "kmcp_…",
"KOMAINU_TESTS_ROOT": "/absolute/path/to/tests"
}
}
}
}
Use ["komainu-mcp@1.1.0"] to pin a release; omit @… to track the latest published version.
If uvx is not on PATH, use the full path to uv’s binary or install uv per Astral’s docs.
Claude Code / other clients
Same idea: command uvx, args ["komainu-mcp@<version>"] (or ["komainu-mcp"]), same env block.
Local test sync tools
komainu-mcp includes built-in sync tools:
sync_push_file(path)sync_push_files(paths)sync_delete_file(path)
No separate komainu-sync installation is required for end users.
These tools read local files directly from the machine running MCP and call
POST /workspace/tests/sync on the backend.
CLI
komainu-mcp --help
komainu-mcp --version
Running komainu-mcp without arguments starts the stdio MCP server: it waits on stdin for your editor’s MCP client. In a bare terminal it looks “stuck” with no output — that is normal. Use --help to print usage without blocking.
If --help also appears to hang, you likely have an old komainu-mcp (no CLI flags). Upgrade: uv pip install -U 'komainu-mcp>=1.1.0' then try again.
Equivalent:
python -m komainu_mcp
uvx and uninstall: uvx does not install into your project venv; it uses uv’s cache. There is no uvx uninstall. To clear downloads for this package: uv cache clean komainu-mcp. Use uv tool uninstall komainu-mcp only if you installed via uv tool install.
Publishing a new version (maintainers, manual)
PyPI project name: komainu-mcp. One-time setup: create that project on pypi.org and generate an API token scoped to it (Account settings → API tokens).
For each release:
-
Bump the version in
komainu-mcp/pyproject.toml([project].version). PyPI does not allow re-uploading the same version number. -
Build from the repository root (mono-repo):
uv build --package komainu-mcp --out-dir komainu-mcp/dist --clear
This writes the sdist and wheel under
komainu-mcp/dist/. -
Upload to PyPI with your token (do not commit the token):
UV_PUBLISH_TOKEN=pypi-xxxxxxxx uv publish komainu-mcp/dist/*
Alternatively:
uv publish -t pypi-xxxxxxxx komainu-mcp/dist/*. -
Verify on
https://pypi.org/project/komainu-mcp/and, if needed, test withuvx komainu-mcp@<new-version>.
If the upload fails because the version already exists, bump version again and repeat from step 2.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file komainu_mcp-1.1.6.tar.gz.
File metadata
- Download URL: komainu_mcp-1.1.6.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a587b54bbf18d3a7439f01186b1fd0ffaed396ce65d3fde88b649ad76658d9d6
|
|
| MD5 |
0516b2792bf5c21e16f24e9c9516278c
|
|
| BLAKE2b-256 |
3a2f9447556f44d64b1710d364e8be409746e7c3fcc0c8d9b2bf11dacf040b27
|
File details
Details for the file komainu_mcp-1.1.6-py3-none-any.whl.
File metadata
- Download URL: komainu_mcp-1.1.6-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4119e0a9764eadc0a8d80f27ddd29f2ee8cc465a28192189607fbf1e6ca5fc2
|
|
| MD5 |
b05ee7aaa1f056de591bb4de14e45d86
|
|
| BLAKE2b-256 |
c670b0a48d78553cd19a1156ef4cf91ca119a5ce3bc3d1e3406f5a7b92cefe30
|