Skip to main content
Glama
pavelpikta

lampa-mcp-server

by pavelpikta

lampa-mcp-server

An MCP server for AI-assisted development on the Lampa open-source TV app.

It gives AI agents (Claude, Cursor, etc.) structured, read-only access to the Lampa source tree — so they understand the repo before making changes.

Runs in two modes:

  • Local stdio — Node process spawned by Cursor / Claude Desktop (unchanged workflow)

  • Cloudflare Workers — remote Streamable HTTP MCP at /mcp with GitHub PAT auth and an R2 source snapshot


What it does

The server exposes discovery, analysis, planning, editing, validation, and Lampa/CUB specialty tools, plus curated resources (lampa://landmarks, lampa://edit-rules, lampa://api-surface).

Preferred agent loop:

snapshot_info → landmarks / plugin_deep_dive
  → search_code (use prefix) | maker_module_map | cub_api_catalog
  → plan_change → draft_patch → validate_plugin | i18n_check

Use resolve_edit_path before editing so you change src/ / plugins/ rather than public/ or build/.


Related MCP server: lsp-intelligence

Requirements

  • Node.js 20+

  • For local mode: a checkout of lampa-source

  • For Workers mode: a Cloudflare account, R2 bucket, KV namespace, and a GitHub Personal Access Token (read:user)


Local stdio setup

git clone <this-repo>
cd lampa-mcp-server
npm install
npm run build
export LAMPA_REPO_PATH=/path/to/lampa-source
npm start

Claude Desktop

{
  "mcpServers": {
    "lampa-mcp-server": {
      "command": "node",
      "args": ["/absolute/path/to/lampa-mcp-server/dist/index.js"],
      "env": {
        "LAMPA_REPO_PATH": "/absolute/path/to/lampa-source"
      }
    }
  }
}

Cursor

{
  "mcpServers": {
    "lampa-mcp-server": {
      "command": "node",
      "args": ["/absolute/path/to/lampa-mcp-server/dist/index.js"],
      "env": {
        "LAMPA_REPO_PATH": "/absolute/path/to/lampa-source"
      }
    }
  }
}

Cloudflare Workers (remote MCP)

Architecture: createMcpHandler (MCP SDK v2, stateless) + R2 Lampa snapshot + GitHub PAT auth via resolveExternalToken on @cloudflare/workers-oauth-provider.

1. Create Cloudflare resources

npx wrangler r2 bucket create lampa-mcp-source
npx wrangler kv namespace create OAUTH_KV

Put the returned KV namespace id into wrangler.jsonc (kv_namespaces[0].id).

2. Create a GitHub Personal Access Token

Create a classic or fine-grained PAT with at least read:user.

No GitHub OAuth App / GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRET is required.

Optional allowlist (comma-separated GitHub logins) in wrangler.jsonc vars or .dev.vars:

ALLOWED_GITHUB_USERS=your-login,coworker

3. Upload a Lampa source snapshot to R2

# clone Lampa if needed
git clone https://github.com/yumata/lampa-source temp/lampa-source

# local Miniflare R2 (for wrangler dev)
npm run snapshot:upload:local

# production R2
npm run snapshot:upload

Objects land under lampa/manifest.json, lampa/bundle.json (all source text), and lampa/indexes/*.json.

4. Deploy

npm run types:worker
npm run deploy

MCP endpoint: https://lampa-mcp-server.<account>.workers.dev/mcp

5. Connect a remote MCP client

Pass the GitHub PAT as a Bearer token. Cursor example:

{
  "mcpServers": {
    "lampa": {
      "url": "https://lampa-mcp-server.<account>.workers.dev/mcp",
      "headers": {
        "Authorization": "Bearer ghp_YOUR_GITHUB_PAT"
      }
    }
  }
}

Or via mcp-remote:

{
  "mcpServers": {
    "lampa": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://lampa-mcp-server.<account>.workers.dev/mcp",
        "--header",
        "Authorization: Bearer ghp_YOUR_GITHUB_PAT"
      ]
    }
  }
}

Prefer storing the PAT in env / secret storage rather than committing it to mcp.json.

Local Worker development

npm run snapshot:upload:local
npm run dev:worker

Then point the MCP inspector / client at http://localhost:8787/mcp with Authorization: Bearer <pat>.


repo_overview → find_feature → module_dependency_map
    → plan_feature_change → draft_patch

For deep plugin work:

plugin_deep_dive → maker_module_map → cub_api_catalog
    → plan_feature_change → draft_patch → validate_plugin

For CUB account/sync work:

cub_auth_guide → cub_api_catalog → cub_sync_guide
    → cub_data_models → cub_endpoint_detail

Project structure

src/
├── index.ts                 # Local stdio entry
├── worker.ts                # Cloudflare Worker + PAT auth entry
├── server.ts                # Shared createLampaServer factory
├── config.ts                # Local Config (NodeRepoFs)
├── auth/github-handler.ts   # Public pages + GitHub PAT validation
├── fs/                      # RepoFs: types, Node, R2, paths
├── utils/                   # Async analysis helpers
├── tools/                   # MCP tools
└── resources/               # MCP resources
scripts/
└── upload-snapshot.mjs      # R2 snapshot + index uploader
wrangler.jsonc

Development

npm run build                # wrangler types + tsc → dist/
npm run dev                  # build, then run stdio server
npm start                    # run compiled stdio server
npm run typecheck            # wrangler types + tsc --noEmit
npm run lint
npm run format
npm run types:worker         # regenerate worker-configuration.d.ts (gitignored)
npm run dev:worker           # wrangler dev
npm run deploy               # wrangler deploy
npm run snapshot:upload:local
npm run snapshot:upload

Dependencies (what / why)

Package

Role

@modelcontextprotocol/server

MCP SDK (stdio + shared server factory)

agents

Workers MCP handler (createMcpHandler)

@cloudflare/workers-oauth-provider

Worker auth wrapper (PAT via resolveExternalToken)

hono

Public HTML routes (/, /authorize)

zod

Tool input schemas

typescript

TypeScript 6 compiler + types for typescript-eslint

wrangler

Deploy, wrangler types, local Worker dev

eslint + typescript-eslint + prettier

Lint / format

Runtime deps ship with both the stdio CLI and the Worker. Dev deps are local-only.


License

MIT

Install Server
A
license - permissive license
B
quality
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    MCP server that provides AI assistants with structured access to codebases via LogicStamp Context, enabling component analysis, dependency graphs, drift detection, and token-optimized context delivery.
    7
    23
    4
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    MCP server providing 29 tools across 5 layers for semantic TypeScript/JavaScript code intelligence, enabling AI agents to find references, trace impacts, guard APIs, and explain errors without text-search false positives.
    28
    1
    MIT
  • A
    license
    -
    quality
    A
    maintenance
    A production-ready MCP server that enables AI assistants to intelligently understand, analyze, edit, navigate, and review software projects with multi-workspace support, Git integration, and semantic search.
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

  • AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.

  • An MCP server that gives your AI access to the source code and docs of all public github repos

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pavelpikta/lampa-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server