eswat2-mcp

System Architecture

One FastAPI app, two transports, five layers — from client transport down to the source-of-truth content it serves.

config.yaml — server identity

name
eswat2:// scheme
display_name
→ app title, manifest
port
→ local deploy (9100)
base_url
→ production URLs
L1 · CLIENTS

Clients

Claude Code

HTTP MCP

Native transport, connects straight to /mcp.

Claude Desktop

stdio

Via mcp-remote proxy, forwarding to /mcp.

Browsers / REST / LLMs

HTTP

Plain requests against the REST routes below.

via
L2 · DEPLOYMENT

Deployment

Local

uvicorn · :9100

./start.sh runs the app in the background; override with MCP_PORT.

Production

Vercel serverless

api/index.py imports app from src/server.py. Live at eswat2-mcp.vercel.app.

Same FastAPI instance either way — deployment only changes the entrypoint, not the app.

hosts
L3 · APP

FastAPI app — server.py

REST API

Discovery

/manifest/manifest.json/llms.txt

Namespaces & content

/list_namespaces/list_uris/list_tags/resolve

Search & graph

/search/graph/graph.json

Pages & ops

/wiki/kb-graph/3d-graph/plan/health

FastMCP — mounted at /mcp

Resources

{namespace}://{slug}eswat2://manifest

Tools

list_namespaces()list_uris()read_uri()list_tags()search_by_tag()get_graph()

Static mounts

/gallery → assets/gallery /fonts

Auto docs

/docs /openapi.json FastAPI defaults, generated from the routes above
loads
L4 · CORE

kb.py — multi-namespace KB loader

Namespaces & entries

  • all_namespaces()
  • has_namespace()
  • list_slugs()
  • get_entry() / load_content()

Tags

  • list_tags()
  • entries_by_tag()

URI & stats

  • parse_uri()
  • kb_stats()
  • total_entry_count()

Loads compiled kbs/*.json into memory at import time. Namespace-aware URI parsing (namespace://slug) backs both the REST and MCP layers above.

reads
L5 · DATA

Data

Source of truth — modules/

profilebio & career
projectsproject index
researchresearch notes
vaultknowledge vault
artart collection
specsUI spec YAML
task build
build_all.py

Compiled — kbs/

profile-kb.json
projects-kb.json
research-kb.json
vault-kb.json
art-kb.json
specs-kb.json

Build is an offline step (task buildscripts/build_all.py, which runs build_kb.py + build_thumbs.py) — not a live request-time dependency.