Repository navigation
fix: MCP scaffold/validate/metrics, agent allowlists, versions - #173
Merged
Merged
Conversation
- MCP get-settlement-metrics uses /metrics (was /v1/metrics, 401). - scaffold-x402-middleware emits a matching handler per route. - validate-payment-config reports schema + route errors together. - Agent enforces allowedMerchants/allowedChains; facilitatorUrl deprecated. - CLI --version and MCP server version read from package.json. Closes #166, closes #167 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NbrZHvYoDo9HCJXRGkVjCF
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Merged
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #166, closes #167. Addresses #169 items 1 and 3.
MCP (#166)
get-settlement-metricscalled/v1/metrics, which falls under the/v1/*auth guard (401).FACILITATOR_ROUTES.metricsis now/metrics(unversioned, unauthenticated, like/health) andFacilitatorClient.getMetricsuses the constant.app.get("/example"), so a paid request settled and then 404'd. The scaffold now generates one handler per route with matching keys. WithbasePath("/api"), the middleware sees the full path, so the key isGET /api/weatherand the handler isapp.get("/weather"). Patterns outside/apiare moved under it (and the note says so). Interpolated strings are escaped withJSON.stringify;PATCHis exported too.isError: true.Agent (#167)
checkPolicy(amount, { payTo, network })enforcesallowedMerchants(EVM case-insensitive) andallowedChains(shorthand or CAIP-2, viaresolveChain). With an allowlist set and the target unknown, the payment is refused. The pre-payment hook passesselectedRequirements.payTo/.network.AgentConfig.facilitatorUrlmarked@deprecated(unused; not removed to avoid a breaking change). README updated.Versions (#169.1)
--versionprinted0.1.0; the MCP server reported0.4.0. Both now readpackage.jsonat runtime viacreateRequire(a static JSON import would fall outsiderootDir). CLI version moved tosrc/version.ts.#169.3 (npm search)
@pincerpay/solanahas the same maintainer, repository andpublishConfigas its siblings, so the missing search result is npm-side indexing; no code change.Tests
packages/mcp/src/__tests__/tool-handlers.test.ts(captures tool handlers with a recording fake server): scaffold keys/handlers match, normalization, escaping, validate collects errors, metrics URL. The validate and metrics tests (4) fail on the previous code.packages/agent: allowlist tests incl. the pre-payment hook. 4 fail on the previousclient.ts.packages/cli:PACKAGE_VERSIONmatches package.json.pnpm build13/13.pnpm test15/16 on the first run; the failure was the known facilitatorshutdown-loadflake (Flaky test: shutdown-load concurrent requests under full suite #161), which passed on rerun (this PR doesn't touch the facilitator).Changeset: patch for core, agent, mcp, cli.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NbrZHvYoDo9HCJXRGkVjCF