-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat: add Archon MCPB bundle #797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughIntroduces a new Archon MCP Proxy Bundle: adds proxy server (stdio JSON-RPC to HTTP), health-check utility, manifest, requirements, .gitignore, and build scripts for macOS/Linux and Windows. The proxy validates Archon health, forwards requests (JSON and SSE handling), manages session ID, and provides user-configurable port and log level. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User as Claude Desktop
participant Proxy as MCP Proxy (stdio)
participant ArchonAPI as Archon API (http)
participant MCP as Archon MCP HTTP
rect rgba(200,220,255,0.25)
note over Proxy: Startup
Proxy->>ArchonAPI: GET /health
ArchonAPI-->>Proxy: 200 OK (ready=true)
end
User->>Proxy: JSON-RPC request (stdin)
alt Notification
Proxy->>MCP: POST /mcp (JSON-RPC notif)
MCP-->>Proxy: 202/204 No content
note right of Proxy: No response sent back
else Request (expects response)
Proxy->>MCP: POST /mcp (JSON-RPC)
alt JSON response
MCP-->>Proxy: 200 OK (application/json)
Proxy-->>User: JSON-RPC response (stdout)
else SSE stream
MCP-->>Proxy: 200 OK (text/event-stream)
Proxy->>Proxy: Parse SSE data events
Proxy-->>User: JSON-RPC response/events
else Error
MCP-->>Proxy: 4xx/5xx
Proxy-->>User: JSON-RPC error
end
note over Proxy: Capture mcp_session_id header
end
sequenceDiagram
autonumber
actor Dev as Developer
participant Script as build-bundle.(sh|ps1)
participant MCPB as mcpb CLI
participant FS as Filesystem
Dev->>Script: Run build-bundle
Script->>FS: Verify manifest, server/proxy.py, requirements.txt, icon.png?
Script->>MCPB: mcpb pack
MCPB-->>Script: Output dir archon-mcpb.mcpb
Script->>FS: Rename to archon.mcpb
Script-->>Dev: Success + bundle size
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🧹 Nitpick comments (17)
archon-mcpb/server/requirements.txt (1)
5-5: Pin httpx to a compatible minor rangeAvoid unexpected breaks from future major/minor changes. Recommend a compatible cap.
-httpx>=0.27.0 +httpx>=0.27,<0.28 +# or, if you prefer compatible releases: +# httpx~=0.27.0archon-mcpb/.gitignore (1)
12-18: Correct keep-list comments to match actual filesComment mentions top-level requirements.txt and mcp_server.py which don’t exist; actual files are server/requirements.txt and server/proxy.py.
-# - requirements.txt -# - build scripts -# - mcp_server.py (entry point template) +# - server/requirements.txt +# - build scripts +# - server/proxy.py (entry point)archon-mcpb/build-bundle.sh (2)
7-7: Harden script failure handlingUse errexit, nounset, and pipefail for more robust builds.
-set -e # Exit on error +set -euo pipefail # Exit on error, undefined var, and pipeline failures
51-57: Remove reference to non-existent ICON_PLACEHOLDER.txtThe file isn’t in the repo; message can be simplified.
- echo " See ICON_PLACEHOLDER.txt to add one" + echo " Add an icon.png (256x256) to include an icon"archon-mcpb/manifest.json (1)
114-121: Constrain mcp_port formatEnsure a numeric port is provided.
"mcp_port": { "type": "string", "title": "MCP Port", "description": "Port for the Archon MCP server (default: 8051)", "default": "8051", + "pattern": "^[0-9]{2,5}$", "required": false, "sensitive": false },archon-mcpb/build-bundle.ps1 (2)
4-6: Enable strict mode for more reliable buildsCatches uninitialized variables and common mistakes.
-$ErrorActionPreference = "Stop" +Set-StrictMode -Version Latest +$ErrorActionPreference = "Stop"
49-55: Remove reference to ICON_PLACEHOLDER.txtAlign with repository contents.
Write-Host " ⚠ Warning: icon.png not found" -ForegroundColor Yellow Write-Host " Bundle will be created without an icon" -ForegroundColor Yellow - Write-Host " See ICON_PLACEHOLDER.txt to add one" -ForegroundColor Yellow + Write-Host " Add icon.png (256x256) to include an icon" -ForegroundColor Yellowarchon-mcpb/README.md (4)
18-20: Add code fence language for the diagram (markdownlint MD040)-``` +```text Claude Desktop → stdio → proxy.py → HTTP → localhost:8051/mcp → Archon MCP Server--- `50-64`: **Add code fence language for tree (markdownlint MD040)** ```diff -``` +```text archon-mcpb/ ├── server/ │ ├── proxy.py # HTTP-to-stdio proxy with session management │ └── requirements.txt # Minimal dependencies (httpx) ├── README.md # This file ├── build-bundle.ps1 # Build script (Windows PowerShell) ├── build-bundle.sh # Build script (Linux/Mac Bash) ├── check-archon.py # Health check utility ├── icon.png # Bundle icon (256x256px, included) └── manifest.json # MCPB manifest with configuration 2 directories, 8 files
77-81: Add code fence language for expected output (markdownlint MD040)-``` +```text ✓ API Server - OK (http://localhost:8181) ✓ MCP Server - OK (http://localhost:8051) ✓ Web UI - OK (http://localhost:3737)
124-127: Manual build list mentions top-level requirements.txtThe bundle uses server/requirements.txt; this line is redundant/misleading.
- for file in ['icon.png', 'README.md', 'LICENSE', 'check-archon.py', 'requirements.txt']: + for file in ['icon.png', 'README.md', 'LICENSE', 'check-archon.py']:archon-mcpb/check-archon.py (2)
134-143: Actually check MCP health (avoid inferring from API)Probe MCP /health directly to surface MCP-only failures.
- # MCP server is verified indirectly through API health - # Direct GET to MCP endpoint will fail with 400 (it expects SSE connections) - mcp_status = "Available (via API)" if api_ok else "Not accessible" - print(f"{GREEN if api_ok else RED}{'✓' if api_ok else '✗'}{RESET} {BOLD}MCP Server{RESET}") - print(f" URL: {ARCHON_MCP_URL}") - print(f" Status: {GREEN if api_ok else RED}{mcp_status}{RESET}") - if api_ok: - print(f" Note: MCP endpoint requires SSE connection (verified via API health)") + # MCP server health (use /health; /mcp expects SSE) + mcp_ok, mcp_error = check_service("MCP Server", "http://localhost:8051/health") + print_service_status("MCP Server", "http://localhost:8051/health", mcp_ok, mcp_error) print()
151-153: Pass the actual MCP status to recommendations- print_recommendations(api_ok, api_ok, ui_ok) + print_recommendations(mcp_ok, api_ok, ui_ok)archon-mcpb/server/proxy.py (4)
132-139: Separate connect/read timeouts for claritySlightly clearer intent and future-proof for SSE.
- async with httpx.AsyncClient(timeout=REQUEST_TIMEOUT) as client: + async with httpx.AsyncClient(timeout=httpx.Timeout(connect=CONNECTION_TIMEOUT, read=REQUEST_TIMEOUT)) as client: # Forward request to Archon MCP HTTP endpoint response = await client.post( ARCHON_MCP_URL, json=request_data, headers=headers )
195-231: More robust SSE parsing (multi-line data support)Current logic only reads the first data: line. Aggregate multi-line data per SSE spec.
- lines = text.split('\n') - - # Find lines starting with "data: " and extract JSON - json_data = None - for line in lines: - line = line.strip() - if line.startswith("data: "): - json_data = line[6:] # Remove "data: " prefix - break + lines = [ln.strip() for ln in text.split('\n')] + # Collect all data: lines from the first event block + data_lines = [] + for ln in lines: + if not ln: + # blank line separates events; stop at end of first event + break + if ln.startswith("data:"): + # support "data:xxx" or "data: xxx" + payload = ln.split("data:", 1)[1].lstrip() + data_lines.append(payload) - if json_data: + if data_lines: try: - result = json.loads(json_data) + json_data = "\n".join(data_lines) + result = json.loads(json_data) logger.info(f"Successfully parsed SSE response") return result
288-296: Import Empty to catch queue timeouts explicitlyAvoid string-matching exception names.
- import threading - from queue import Queue + import threading + from queue import Queue, Empty
311-360: Catch queue.Empty explicitly instead of string-matchingCleaner and less error-prone.
- except Exception as e: - # Check if it's just a timeout (normal operation) - if "Empty" in str(type(e).__name__): - # Queue timeout - just continue - continue - logger.error(f"Error in proxy loop: {e}", exc_info=True) - break + except Empty: + # Queue get() timeout - continue polling + continue + except Exception as e: + logger.error(f"Error in proxy loop: {e}", exc_info=True) + break
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
archon-mcpb/icon.pngis excluded by!**/*.png
📒 Files selected for processing (8)
archon-mcpb/.gitignore(1 hunks)archon-mcpb/README.md(1 hunks)archon-mcpb/build-bundle.ps1(1 hunks)archon-mcpb/build-bundle.sh(1 hunks)archon-mcpb/check-archon.py(1 hunks)archon-mcpb/manifest.json(1 hunks)archon-mcpb/server/proxy.py(1 hunks)archon-mcpb/server/requirements.txt(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
archon-mcpb/check-archon.py (1)
archon-mcpb/server/proxy.py (1)
main(363-414)
archon-mcpb/server/proxy.py (1)
archon-mcpb/check-archon.py (1)
main(123-161)
🪛 LanguageTool
archon-mcpb/README.md
[grammar] ~5-~5: There might be a mistake here.
Context: ...rchon installation. ## 📦 What is this? An MCPB bundle (.mcpb file) is a s...
(QB_NEW_EN)
[grammar] ~9-~9: There might be a mistake here.
Context: ...a lightweight connection proxy that: - Provides single-click installation in Cl...
(QB_NEW_EN)
[grammar] ~10-~10: There might be a mistake here.
Context: ...gle-click installation in Claude Desktop - Forwards MCP requests from your AI clien...
(QB_NEW_EN)
[grammar] ~11-~11: There might be a mistake here.
Context: ... client to the running Archon MCP server - Validates connection before starting - H...
(QB_NEW_EN)
[grammar] ~12-~12: There might be a mistake here.
Context: ...r - Validates connection before starting - Handles session management, SSE parsing,...
(QB_NEW_EN)
[grammar] ~13-~13: There might be a mistake here.
Context: ... SSE parsing, and JSON-RPC notifications - Configurable ports for flexible deployme...
(QB_NEW_EN)
[grammar] ~16-~16: There might be a mistake here.
Context: ... flexible deployment ## 🔌 Architecture Claude Desktop → stdio → proxy.py → HTTP → localhost:8051/mcp → Archon MCP Server The bundle contains a robust proxy that:...
(QB_NEW_EN)
[grammar] ~22-~22: There might be a mistake here.
Context: ...The bundle contains a robust proxy that: 1. Validates Archon API is running at `loca...
(QB_NEW_EN)
[grammar] ~24-~24: There might be a mistake here.
Context: ...erver at localhost:8051 (configurable) 3. Forwards stdin/stdout MCP protocol to HT...
(QB_NEW_EN)
[grammar] ~25-~25: There might be a mistake here.
Context: ...col to HTTP with proper session handling 4. Parses Server-Sent Events (SSE) response...
(QB_NEW_EN)
[grammar] ~26-~26: There might be a mistake here.
Context: ...arses Server-Sent Events (SSE) responses 5. Handles JSON-RPC notifications correctly...
(QB_NEW_EN)
[grammar] ~27-~27: There might be a mistake here.
Context: ...tifications correctly (no response sent) 6. Provides clear error messages if Archon ...
(QB_NEW_EN)
[grammar] ~39-~39: There might be a mistake here.
Context: ...irectory - API server accessible at: http://localhost:8181 - MCP server accessible at: `http://localh...
(QB_NEW_EN)
[grammar] ~42-~42: There might be a mistake here.
Context: ...efault, configurable) 2. Python 3.12+ - Required for running the proxy - Only...
(QB_NEW_EN)
[grammar] ~48-~48: There might be a mistake here.
Context: ...these configured. ## 📋 Bundle Contents archon-mcpb/ ├── server/ │ ├── proxy.py # HTTP-to-stdio proxy with session management │ └── requirements.txt # Minimal dependencies (httpx) ├── README.md # This file ├── build-bundle.ps1 # Build script (Windows PowerShell) ├── build-bundle.sh # Build script (Linux/Mac Bash) ├── check-archon.py # Health check utility ├── icon.png # Bundle icon (256x256px, included) └── manifest.json # MCPB manifest with configuration 2 directories, 8 files ## 🚀 Quick Start ### Step 1: Verify Archo...
(QB_NEW_EN)
[grammar] ~65-~65: There might be a mistake here.
Context: ...ectories, 8 files ``` ## 🚀 Quick Start ### Step 1: Verify Archon is Running Before...
(QB_NEW_EN)
[grammar] ~130-~130: There might be a mistake here.
Context: ...rite(file) " ``` ## 📖 Using the Bundle ### Installation in Claude Desktop 1. Ensur...
(QB_NEW_EN)
[grammar] ~137-~137: There might be a mistake here.
Context: ... settings (see below) 4. The proxy will validate connection and start ### Configuration...
(QB_NEW_EN)
[grammar] ~143-~143: There might be a mistake here.
Context: ...ing | Description | Default | Required | |---------|-------------|---------|-----...
(QB_NEW_EN)
[grammar] ~144-~144: There might be a mistake here.
Context: ...----|-------------|---------|----------| | mcp_port | Port for MCP server | 805...
(QB_NEW_EN)
[grammar] ~145-~145: There might be a mistake here.
Context: ...ort| Port for MCP server | 8051 | No | |log_level` | Logging verbosity (DEBUG...
(QB_NEW_EN)
[grammar] ~148-~148: There might be a mistake here.
Context: ...ixed Configuration** (not configurable): - API URL: http://localhost:8181 (valida...
(QB_NEW_EN)
[grammar] ~149-~149: There might be a mistake here.
Context: ...//localhost:8181(validated on startup) - Host:localhost` (proxy always connects...
(QB_NEW_EN)
[grammar] ~160-~160: There might be a mistake here.
Context: ...p://localhost:{mcp_port}/mcp Example: If MCP server is on port 9051, setmcp_po...
(QB_NEW_EN)
[grammar] ~164-~164: There might be a mistake here.
Context: ...ion After installation, the proxy will: 1. Validate Archon API server is accessible...
(QB_NEW_EN)
[grammar] ~166-~166: There might be a mistake here.
Context: ...localhost:8181` 2. Store MCP session ID from first request 3. Forward all MCP reques...
(QB_NEW_EN)
[grammar] ~166-~166: There might be a mistake here.
Context: ... Store MCP session ID from first request 3. Forward all MCP requests with proper ses...
(QB_NEW_EN)
[grammar] ~167-~167: There might be a mistake here.
Context: ... requests with proper session management 4. Provide all Archon MCP tools to Claude D...
(QB_NEW_EN)
[grammar] ~181-~181: There might be a mistake here.
Context: ...1/health ``` ## 🛠️ Available MCP Tools Once connected, you'll have access to: ...
(QB_NEW_EN)
[grammar] ~211-~211: There might be a mistake here.
Context: ...ssion information ## 🔧 Troubleshooting ### "Cannot connect to Archon at http://loca...
(QB_NEW_EN)
[grammar] ~217-~217: There might be a mistake here.
Context: ...unning or not accessible. Solution: 1. Run health check: `python check-archon.p...
(QB_NEW_EN)
[grammar] ~218-~218: There might be a mistake here.
Context: ...le. Solution: 1. Run health check: python check-archon.py 2. Start Archon: `cd archon && docker compo...
(QB_NEW_EN)
[grammar] ~219-~219: There might be a mistake here.
Context: ...ython check-archon.py2. Start Archon:cd archon && docker compose up -d3. Verify API:curl http://localhost:8181/...
(QB_NEW_EN)
[grammar] ~220-~220: There might be a mistake here.
Context: ...&& docker compose up -d3. Verify API:curl http://localhost:8181/health` 4. Check Docker logs: `docker compose logs ...
(QB_NEW_EN)
[grammar] ~227-~227: There might be a mistake here.
Context: ...or wrong port configured. Solution: 1. Verify MCP server: `curl http://localhos...
(QB_NEW_EN)
[grammar] ~228-~228: There might be a mistake here.
Context: ...d. Solution: 1. Verify MCP server: curl http://localhost:8051/health 2. Check Docker logs: `docker compose logs ...
(QB_NEW_EN)
[style] ~235-~235: Consider using a different verb for a more formal wording.
Context: ...**: Session management issue (should be fixed in latest version). Solution: 1. U...
(FIX_RESOLVE)
[grammar] ~235-~235: There might be a mistake here.
Context: ...ssion management issue (should be fixed in latest version). Solution: 1. Upda...
(QB_NEW_EN)
[grammar] ~237-~237: There might be a mistake here.
Context: ...fixed in latest version). Solution: 1. Update to latest bundle version 2. Resta...
(QB_NEW_EN)
[grammar] ~238-~238: There might be a mistake here.
Context: ...test version). Solution: 1. Update to latest bundle version 2. Restart Claude...
(QB_NEW_EN)
[grammar] ~246-~246: There might be a mistake here.
Context: ... not installed correctly. Solution: 1. Check Claude Desktop logs (Settings → MC...
(QB_NEW_EN)
[grammar] ~254-~254: There might be a mistake here.
Context: ...-RPC protocol mismatch (should be fixed in latest version). Solution: 1. Ensu...
(QB_NEW_EN)
[grammar] ~256-~256: There might be a mistake here.
Context: ...fixed in latest version). Solution: 1. Ensure you're using the latest bundle 2....
(QB_NEW_EN)
[grammar] ~259-~259: There might be a mistake here.
Context: ...RPC notifications (no response sent) 3. If issue persists, report at: https://gith...
(QB_NEW_EN)
[grammar] ~261-~261: There might be a mistake here.
Context: ...am00/archon/issues ## 🔍 Proxy Features The proxy implements robust MCP protocol...
(QB_NEW_EN)
[grammar] ~265-~265: There might be a mistake here.
Context: ...otocol handling: ### Session Management - Captures mcp-session-id header from in...
(QB_NEW_EN)
[grammar] ~270-~270: There might be a mistake here.
Context: ...nnection lifetime ### Response Handling - Parses Server-Sent Events (SSE) multi-li...
(QB_NEW_EN)
[grammar] ~271-~271: There might be a mistake here.
Context: ...rver-Sent Events (SSE) multi-line format - Handles both text/event-stream and `ap...
(QB_NEW_EN)
[grammar] ~272-~272: There might be a mistake here.
Context: ...streamandapplication/json` responses - Accepts 200 OK and 202 Accepted status c...
(QB_NEW_EN)
[grammar] ~275-~275: There might be a mistake here.
Context: ... status codes ### Notification Handling - Detects JSON-RPC notifications (requests...
(QB_NEW_EN)
[grammar] ~276-~276: There might be a mistake here.
Context: ...ifications (requests with no id field) - Correctly skips sending responses for no...
(QB_NEW_EN)
[grammar] ~277-~277: There might be a mistake here.
Context: ...kips sending responses for notifications - Complies with JSON-RPC 2.0 specification...
(QB_NEW_EN)
[grammar] ~280-~280: There might be a mistake here.
Context: ...PC 2.0 specification ### Error Handling - Validates Archon connection before start...
(QB_NEW_EN)
[grammar] ~285-~285: There might be a mistake here.
Context: ...for debugging ### Windows Compatibility - Thread-based stdin reading (avoids Proac...
(QB_NEW_EN)
[grammar] ~286-~286: There might be a mistake here.
Context: ...eading (avoids ProactorEventLoop issues) - Works on all platforms (Windows, Linux, ...
(QB_NEW_EN)
[grammar] ~289-~289: There might be a mistake here.
Context: ...inux, macOS) ## 📚 Additional Resources - [Main Archon Documentation](https://githu...
(QB_NEW_EN)
[grammar] ~291-~291: There might be a mistake here.
Context: ... Resources - Main Archon Documentation - [MCPB Specification](https://github.com/a...
(QB_NEW_EN)
[grammar] ~292-~292: There might be a mistake here.
Context: ...m/coleam00/archon) - MCPB Specification - [MCP Protocol](https://modelcontextprotoc...
(QB_NEW_EN)
[grammar] ~293-~293: There might be a mistake here.
Context: ...hub.com/anthropics/mcpb) - MCP Protocol - [Archon Issues](https://github.com/coleam...
(QB_NEW_EN)
[grammar] ~296-~296: There might be a mistake here.
Context: .../archon/issues) ## 📝 Development Notes ### Architecture The Archon MCP server uses...
(QB_NEW_EN)
[grammar] ~300-~300: There might be a mistake here.
Context: ...r uses a microservices architecture: - MCP server is lightweight (HTTP client o...
(QB_NEW_EN)
[grammar] ~302-~302: There might be a mistake here.
Context: ...ons (crawling, embeddings, RAG) handled by backend - Connects via HTTP to `archon-...
(QB_NEW_EN)
[grammar] ~323-~323: There might be a mistake here.
Context: ...rShell script for Windows Both scripts: 1. Validate required files exist 2. Check f...
(QB_NEW_EN)
[grammar] ~327-~327: There might be a mistake here.
Context: ...o create the bundle 4. Rename output to archon.mcpb 5. Display bundle size and next steps ## ?...
(QB_NEW_EN)
[grammar] ~330-~330: There might be a mistake here.
Context: ... size and next steps ## 🤝 Contributing To improve this bundle: 1. Test installa...
(QB_NEW_EN)
[grammar] ~332-~332: There might be a mistake here.
Context: ...🤝 Contributing To improve this bundle: 1. Test installation in different AI client...
(QB_NEW_EN)
[grammar] ~341-~341: There might be a mistake here.
Context: ...ithub.com/coleam00/archon ## 📄 License Archon Community License (ACL) v1.2 - Se...
(QB_NEW_EN)
[grammar] ~343-~343: There might be a mistake here.
Context: ...munity License (ACL) v1.2 - See LICENSE
(QB_NEW_EN)
🪛 markdownlint-cli2 (0.18.1)
archon-mcpb/README.md
18-18: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
50-50: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
77-77: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
91-91: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
111-111: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
213-213: Bare URL used
(MD034, no-bare-urls)
259-259: Bare URL used
(MD034, no-bare-urls)
339-339: Bare URL used
(MD034, no-bare-urls)
🔇 Additional comments (1)
archon-mcpb/server/proxy.py (1)
294-336: Framing approach is correct per MCP stdio spec Existing line-by-line JSON reading matches the newline-delimited requirement in the Model Context Protocol.
| "manifest_version": "0.2", | ||
| "name": "archon", | ||
| "display_name": "Archon MCP", | ||
| "version": "0.1.0", | ||
| "description": "Connection proxy for Archon MCP Server - Knowledge management and RAG search for AI coding assistants", | ||
| "long_description": "Archon MCP Connection Proxy enables easy integration with AI clients like Claude Desktop. This lightweight proxy connects to your running Archon instance, providing access to custom knowledge bases, semantic search, and task management.\n\nIMPORTANT PREREQUISITES:- Archon must be running: docker compose up -d\n- Archon backend accessible at http://localhost:8181 (will be verified on startup)\n- Archon MCP server accessible at http://localhost:8051/mcp (configurable)\n- This is a CONNECTION PROXY - it forwards requests to your running Archon instance\n- Start Archon first: cd archon && docker compose up -d\n- Manage knowledge base through Archon web UI: http://localhost:3737", | ||
| "author": { | ||
| "name": "Cole Medin & Archon Contributors", | ||
| "email": "[email protected]", | ||
| "url": "https://github.com/coleam00/archon" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/coleam00/archon" | ||
| }, | ||
| "homepage": "https://github.com/coleam00/archon", | ||
| "documentation": "https://github.com/coleam00/archon#readme", | ||
| "support": "https://github.com/coleam00/archon/issues", | ||
| "icon": "icon.png", | ||
| "server": { | ||
| "type": "python", | ||
| "entry_point": "server/proxy.py", | ||
| "mcp_config": { | ||
| "command": "python", | ||
| "args": [ | ||
| "${__dirname}/server/proxy.py" | ||
| ], | ||
| "env": { | ||
| "ARCHON_API_URL": "http://localhost:8181", | ||
| "ARCHON_MCP_PORT": "${user_config.mcp_port}", | ||
| "LOG_LEVEL": "${user_config.log_level}" | ||
| } | ||
| } | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
🧩 Analysis chain
Verify manifest schema details
Please confirm:
- manifest_version "0.2" is supported by current MCPB.
- ${__dirname} interpolation in args is supported.
🌐 Web query:
Is MCPB manifest_version "0.2" valid, and does MCPB support ${__dirname} in server.mcp_config.args for Python servers?
💡 Result:
Short answers:
- manifest_version "0.2": not an official, universally‑documented MCPB field — some community examples/use it (manifest_version: "0.2"), but Anthropic’s published spec/docs reference the mcpb_version field (and examples show mcpb_version "0.1"). So "manifest_version": "0.2" may work in some toolchains/community bundles but isn’t the stable, authoritative field in Anthropic’s docs. [1][2]
- ${__dirname} in server.mcp_config.args: yes — the unpacked bundle directory variable (${__dirname}) is supported and is expanded to the extension’s unpacked path (so you can use "${__dirname}/server/...") in MCPB manifests. [1][3]
Sources:
[1] Anthropic — Claude Desktop / desktop-extensions (describes mcpb/mcpb_version and ${__dirname} expansion). (anthropic.com)
[2] Community/example references showing manifest_version: "0.2" in MCPB manifests (community changelogs/blogs). (gyliu513.github.io)
[3] MCPB / .mcpb example docs showing ${__dirname} used in mcp_config.args. (mcpbundles.com)
Citations:
- 1: https://www.anthropic.com/engineering/desktop-extensions?asuniq=7fb49c72&utm_source=openai
- 2: https://gyliu513.github.io/jekyll/update/2025/09/29/mcpb.html?utm_source=openai
- 3: https://mcpbundles.com/docs/concepts/mcpb-files?utm_source=openai
Use mcpb_version in manifest
Replace "manifest_version": "0.2" with the official "mcpb_version": "0.1". ${__dirname} in server.mcp_config.args is supported, no changes needed.
🤖 Prompt for AI Agents
In archon-mcpb/manifest.json around lines 2 to 35, the manifest uses the wrong
key "manifest_version": "0.2"; replace that key with the official
"mcpb_version": "0.1" (remove the old manifest_version entry and add
mcpb_version with value "0.1"); leave server.mcp_config.args as-is since
${__dirname} is supported and requires no change.
| "log_level": { | ||
| "type": "string", | ||
| "title": "Log Level", | ||
| "description": "Logging verbosity: DEBUG, INFO, WARNING, or ERROR (optional)", | ||
| "default": "INFO", | ||
| "required": false, | ||
| "sensitive": false | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Validate log_level via enum to prevent invalid values
Prevents crashes from unsupported LOG_LEVEL values at runtime.
- "log_level": {
- "type": "string",
- "title": "Log Level",
- "description": "Logging verbosity: DEBUG, INFO, WARNING, or ERROR (optional)",
- "default": "INFO",
- "required": false,
- "sensitive": false
- }
+ "log_level": {
+ "type": "string",
+ "title": "Log Level",
+ "description": "Logging verbosity",
+ "enum": ["DEBUG", "INFO", "WARNING", "ERROR"],
+ "default": "INFO",
+ "required": false,
+ "sensitive": false
+ }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "log_level": { | |
| "type": "string", | |
| "title": "Log Level", | |
| "description": "Logging verbosity: DEBUG, INFO, WARNING, or ERROR (optional)", | |
| "default": "INFO", | |
| "required": false, | |
| "sensitive": false | |
| } | |
| "log_level": { | |
| "type": "string", | |
| "title": "Log Level", | |
| "description": "Logging verbosity", | |
| "enum": ["DEBUG", "INFO", "WARNING", "ERROR"], | |
| "default": "INFO", | |
| "required": false, | |
| "sensitive": false | |
| } |
🤖 Prompt for AI Agents
In archon-mcpb/manifest.json around lines 122 to 129, the log_level property
currently accepts any string which can lead to unsupported values at runtime;
add an "enum" with the allowed values (e.g. ["DEBUG","INFO","WARNING","ERROR"])
to the log_level schema so the manifest validator will reject invalid entries,
keep the default as "INFO", and update the description to document the accepted
enum values; no runtime code changes required beyond relying on the validated
manifest.
| # Configure logging | ||
| LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO") | ||
| logging.basicConfig( | ||
| level=getattr(logging, LOG_LEVEL), | ||
| format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", | ||
| stream=sys.stderr # Log to stderr to not interfere with stdio protocol | ||
| ) | ||
| logger = logging.getLogger("archon-mcp-proxy") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Robust LOG_LEVEL parsing to avoid crashes
getattr(logging, LOG_LEVEL) will raise on invalid values. Normalize and default safely.
-LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")
-logging.basicConfig(
- level=getattr(logging, LOG_LEVEL),
+LOG_LEVEL_NAME = os.getenv("LOG_LEVEL", "INFO").upper()
+try:
+ _level = int(LOG_LEVEL_NAME)
+except ValueError:
+ _level = getattr(logging, LOG_LEVEL_NAME, logging.INFO)
+logging.basicConfig(
+ level=_level,
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
stream=sys.stderr # Log to stderr to not interfere with stdio protocol
)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Configure logging | |
| LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO") | |
| logging.basicConfig( | |
| level=getattr(logging, LOG_LEVEL), | |
| format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", | |
| stream=sys.stderr # Log to stderr to not interfere with stdio protocol | |
| ) | |
| logger = logging.getLogger("archon-mcp-proxy") | |
| # Configure logging | |
| LOG_LEVEL_NAME = os.getenv("LOG_LEVEL", "INFO").upper() | |
| try: | |
| _level = int(LOG_LEVEL_NAME) | |
| except ValueError: | |
| _level = getattr(logging, LOG_LEVEL_NAME, logging.INFO) | |
| logging.basicConfig( | |
| level=_level, | |
| format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", | |
| stream=sys.stderr # Log to stderr to not interfere with stdio protocol | |
| ) | |
| logger = logging.getLogger("archon-mcp-proxy") |
🤖 Prompt for AI Agents
In archon-mcpb/server/proxy.py around lines 29 to 36, the code uses
getattr(logging, LOG_LEVEL) which will raise if LOG_LEVEL is invalid; normalize
the env value (e.g., .upper()), then resolve the numeric level safely by using a
fallback (for example use getattr(logging, normalized_level, logging.INFO) or
mapping via logging._nameToLevel.get(normalized_level, logging.INFO)) and pass
that resolved level to logging.basicConfig so invalid/unknown LOG_LEVEL values
default to INFO instead of crashing.
| # Log response details for debugging | ||
| logger.info(f"MCP Response - Status: {response.status_code}, Content-Type: {response.headers.get('Content-Type', 'unknown')}, Length: {len(response.content)} bytes") | ||
| if len(response.content) > 0 and len(response.content) < 1000: | ||
| logger.info(f"MCP Response content: {response.text}") | ||
| elif len(response.content) > 0: | ||
| logger.info(f"MCP Response preview: {response.text[:500]}...") | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid logging response bodies at INFO (privacy/noise)
Bodies can contain user data; restrict to DEBUG.
- if len(response.content) > 0 and len(response.content) < 1000:
- logger.info(f"MCP Response content: {response.text}")
- elif len(response.content) > 0:
- logger.info(f"MCP Response preview: {response.text[:500]}...")
+ if len(response.content) > 0 and len(response.content) < 1000:
+ logger.debug(f"MCP Response content: {response.text}")
+ elif len(response.content) > 0:
+ logger.debug(f"MCP Response preview: {response.text[:500]}...")📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Log response details for debugging | |
| logger.info(f"MCP Response - Status: {response.status_code}, Content-Type: {response.headers.get('Content-Type', 'unknown')}, Length: {len(response.content)} bytes") | |
| if len(response.content) > 0 and len(response.content) < 1000: | |
| logger.info(f"MCP Response content: {response.text}") | |
| elif len(response.content) > 0: | |
| logger.info(f"MCP Response preview: {response.text[:500]}...") | |
| # Log response details for debugging | |
| logger.info(f"MCP Response - Status: {response.status_code}, Content-Type: {response.headers.get('Content-Type', 'unknown')}, Length: {len(response.content)} bytes") | |
| if len(response.content) > 0 and len(response.content) < 1000: | |
| logger.debug(f(MCP Response content: {response.text}") | |
| elif len(response.content) > 0: | |
| logger.debug(f(MCP Response preview: {response.text[:500]}...") |
🤖 Prompt for AI Agents
In archon-mcpb/server/proxy.py around lines 150 to 156, the code logs response
bodies at INFO which may expose user data and create noise; change the two
logger.info calls that emit MCP Response content/preview to logger.debug (and
optionally guard them with logger.isEnabledFor(logging.DEBUG)) so detailed
bodies are only recorded at DEBUG level, keep the initial
status/content-type/length line at INFO as-is.
Pull Request
Summary
Adds a self-contained MCPB bundle under
archon-mcpb/to demonstrate integration with Archon and MCP-compatible AI clients.Changes Made
archon.mcpbto/archon-mcpb/Type of Change
Affected Services
archon.mcpb
Testing
This is a lightweight connection proxy:
Claude Desktop → stdio → proxy.py → HTTP → localhost:8051/mcp → Archon MCP Server
Test Evidence
Just a wrapper around the current MCP Tools.
Checklist
Breaking Changes
NONE
Additional Notes
Cole, I wasn't sure if you wanted me to add a note to the main README.md about this change, as currently all this is documented within the Archon MCP Status Dashboard.
Summary by CodeRabbit
New Features
Documentation
Chores