Skip to main content

unlost-mcp

MCP server (stdio) that exposes unlost machine APIs (/api/v1/chats、/api/v1/messages 及媒体相关只读接口) to hosts such as Cursor, authenticated with an API Token from Settings → 集成.

Tools are read-only; summarization stays in the agent — there is no summarize tool.

Requirements

  • Python 3.11+
  • uv(推荐用 uvx / uv run)
  • 可达的 unlost 后端(UNLOST_BASE_URL)
  • API Token(Settings → 集成)

1. Cursor MCP(推荐:本地 uv run)

未发布到 PyPI 时,用 monorepo 里的包直接跑:

{
  "mcpServers": {
    "unlost": {
      "command": "uv",
      "args": [
        "--directory",
        "/ABS/PATH/unlost/mcp",
        "run",
        "unlost-mcp"
      ],
      "env": {
        "UNLOST_BASE_URL": "http://127.0.0.1:8000",
        "UNLOST_API_TOKEN": "ul_...."
      }
    }
  }
}

发布到 PyPI 后(可选)

{
  "mcpServers": {
    "unlost": {
      "command": "uvx",
      "args": ["unlost-mcp"],
      "env": {
        "UNLOST_BASE_URL": "https://unlost.onelooker.cc",
        "UNLOST_API_TOKEN": "ul_...."
      }
    }
  }
}

固定版本示例:"args": ["unlost-mcp==0.1.0"]。

2. Local install / debug

cd mcp
uv sync
export UNLOST_BASE_URL=http://127.0.0.1:8000
export UNLOST_API_TOKEN=ul_....
uv run unlost-mcp

stdio:等待 MCP host;缺环境变量时 stderr 提示并以 code 1 退出。

等价入口:uv run python -m unlost_mcp。

3. Publish to PyPI(维护者)

cd mcp
uv build
uv publish

发版前 bump pyproject.toml 的 version,再 uv build && uv publish。

4. Tools

Tool Maps to
list_chats(source?) GET /api/v1/chats
fetch_messages(chat_id?, source?, date_from?, date_to?, after_id?, limit?) GET /api/v1/messages(条目含 media[])
get_message(chat_id, message_id, source?) GET /api/v1/messages/get_one(单条完整媒体)
list_attachments(category, chat_id?, …) GET /api/v1/messages/list_attachments(media / file / link)

media[] 字段含 kind、mime、size、file_name、width/height、status、公开 url(MinIO)。HTTP error bodies are returned as tool text (no extra wrapping).

5. Security

  • Never commit UNLOST_API_TOKEN / PyPI token。
  • Token 与 REST /api/v1、Webhook 共用;在 Settings → 集成里吊销即可。

Metadata

Release files for unlost-mcp 0.1.1

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

Source distribution (sdist)

Source distribution for unlost-mcp 0.1.1
File Size Uploaded Provenance Actions
unlost_mcp-0.1.1.tar.gz 54.2 kB Without provenance Details for unlost_mcp-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for unlost-mcp 0.1.1
File Interpreter ABI Platform Actions
unlost_mcp-0.1.1-py3-none-any.whl Python 3 none any Details for unlost_mcp-0.1.1-py3-none-any.whl

Total release size: 60.2 kB

Release files / unlost_mcp-0.1.1.tar.gz

Download URL unlost_mcp-0.1.1.tar.gz
Size 54.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0174e58d544e65cf2b52db994caa82a1280089b216f5bedf6fffaf45113b7f75
BLAKE2b-256 checksum
How to use checksums
c8a373dcba30b4fee8760883161854f1882696b1e9e1cac82642d1613e5ae529
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.8

Release files / unlost_mcp-0.1.1-py3-none-any.whl

Download URL unlost_mcp-0.1.1-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a2daf51f7629143e411ede5e9e168fd8179abef23ee7a62f6f7f273477ed5ab
BLAKE2b-256 checksum
How to use checksums
e18d549bf8c0a1e159dd7e58a75d7a1a538ddea5161c9c3c448bf4ea898141dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.8

Security for unlost-mcp 0.1.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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