- apps/mcp/src/http.ts: serve MCP over Streamable HTTP (MCP 2025-03-26) on :4021, stateless mode (sessionIdGenerator undefined), CORS on /mcp. Remote clients can now call the 6 tools + 4 resources without a stdio subprocess. - deploy/mcpedia-mcp.service: supervised systemd unit (MCP_PORT=4021). - Caddy: mcp.asepharyana.my.id -> 4021; wiki. domain now also routes /trpc/* to the API (was swallowed by web -> tRPC was unreachable on the domain). - apps/api: restoreRevision tRPC mutation now requires x-webhook-secret (the Web UI calls @mcpedia/core directly, so this only gates the open network endpoint). Threads the header into tRPC Context. Secures a state-changing action that was anonymously callable. Verified live: https://mcp.asepharyana.my.id/mcp initialize/tools/list/ resources/list all 200; restoreRevision no-secret -> unauthorized, with-secret -> handler; read-only tRPC reachable via domain.
31 lines
822 B
JSON
31 lines
822 B
JSON
{
|
|
"name": "mcpedia",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"packageManager": "bun@1.3.14",
|
|
"workspaces": [
|
|
"apps/*",
|
|
"packages/*",
|
|
"scripts"
|
|
],
|
|
"scripts": {
|
|
"dev": "turbo run dev",
|
|
"build": "turbo run build",
|
|
"lint": "turbo run lint",
|
|
"typecheck": "turbo run typecheck",
|
|
"index": "bun run scripts/indexer.ts",
|
|
"enqueue": "bun run scripts/enqueue.ts",
|
|
"worker": "/home/code/.bun/bin/bun --cwd apps/worker src/index.ts",
|
|
"mcp": "bun --cwd apps/mcp run start",
|
|
"mcp:http": "/home/code/.bun/bin/bun --cwd apps/mcp src/http.ts",
|
|
"api": "/home/code/.bun/bin/bun --cwd apps/api src/index.ts"
|
|
},
|
|
"devDependencies": {
|
|
"@trpc/client": "^11.18.0",
|
|
"@types/node": "^26.2.0",
|
|
"prettier": "^3.3.0",
|
|
"turbo": "^2.5.0",
|
|
"typescript": "^5.6.0"
|
|
}
|
|
}
|