PR #1 — Harden runtime + A2A (adapter gated) #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR hardens the existing MCP server runtime and adds a minimal, gated Agent-to-Agent (A2A) adapter for future multi-agent interoperability.
It builds on the
Developerayo/concordium-mcp-serverbaseline and introduces a production-ready container, strict runtime posture, health checks, and foundational observability.A2A support is behind a feature flag and can be enabled via environment variables.
Rationale
Improve security and operational posture before extending MCP functionality.
Prepare the Concordium MCP Server for agentic commerce and multi-agent (A2A) protocols such as Google A2A and AP2.
Maintain backward compatibility while introducing extensibility for future PLT/XCF tools.
Scope (v1)
New features
✅ Hardened Express runtime
HTTPS-only expectation; HSTS handled at edge.
CORS allowlist, bearer-token authentication.
Global timeouts, per-tool rate limits, structured JSON logging.
✅ Health & readiness endpoints
/healthz– liveness/readyz– readiness (stub; passes until finality lag probe added in PR 2)✅ A2A adapter (feature-flagged)
/.well-known/agent-card.jsonfor discovery/a2a/jsonrpcminimal JSON-RPC 2.0 endpoint (message/send,tasks/get,tasks/cancel)In-memory task store (non-persistent)
Disabled by default (
A2A_ENABLED=false)✅ Configuration
Centralized
src/config.tsfor environment variables.Example
.env.exampleincluded.✅ Observability
Pino JSON logging (trace ID, tool, latency).
Trace middleware (
withTrace).✅ Security
Helmet, CORS, rate limiting, deadline middleware.
Non-root runtime user, distroless container, pinned base digest.
✅ CI / Ops
Dependabot weekly scans for npm + GitHub Actions.
CodeQL workflow (JavaScript) enabled.
Configuration (environment variables)
Files Added / Modified
Future Work (PR #2)
Implement PLT (CIS-7) finalized transfer tool (
getFinalizedTransfers).Add PLT registry and
resolvePlt.Introduce XCF helpers (
watchChallenge,verifyReceipt).Extend structured logging with finality lag probe.