Harden server; add authenticated Streamable HTTP transport and Nix module

- Streamable HTTP transport (MCP_TRANSPORT=http) with mandatory auth:
  static bearer tokens or OIDC resource-server mode (JWT via JWKS, or
  RFC 7662 introspection), RFC 9728 protected-resource metadata, and
  DNS-rebinding protection
- secrets loadable from files via *_FILE variants
- timeouts on all outbound requests; JORTT_READ_ONLY tool filtering
- OpenAPI spec committed and bundled; no implicit network fetches
- Nix flake: sandboxed package build + hardened NixOS module taking an
  EnvironmentFile (agenix-friendly)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Claude 2026-07-11 19:10:55 +02:00
parent 240a53fade
commit a73af353d4
17 changed files with 1255 additions and 77 deletions

View file

@ -1,6 +1,6 @@
{
"name": "jortt-mcp",
"version": "0.1.0",
"version": "0.2.0",
"description": "Model Context Protocol server for the Jortt accounting API",
"license": "MIT",
"type": "module",
@ -13,8 +13,7 @@
],
"scripts": {
"fetch-spec": "node scripts/fetch-spec.mjs",
"build": "npm run fetch-spec && tsc && node -e \"require('fs').copyFileSync('src/openapi.json','dist/openapi.json')\"",
"prepare": "npm run build",
"build": "tsc && node -e \"require('fs').copyFileSync('src/openapi.json','dist/openapi.json')\"",
"start": "node dist/index.js",
"dev": "tsc --watch",
"typecheck": "tsc --noEmit"
@ -31,7 +30,8 @@
"node": ">=18"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.12.0"
"@modelcontextprotocol/sdk": "^1.29.0",
"jose": "^6.0.0"
},
"devDependencies": {
"@types/node": "^22.10.0",