Skip to content

SWI-10226 feat: add Express Registration API + zero-to-one auth flow#6

Open
kshahbw wants to merge 8 commits intomainfrom
feat/express-registration
Open

SWI-10226 feat: add Express Registration API + zero-to-one auth flow#6
kshahbw wants to merge 8 commits intomainfrom
feat/express-registration

Conversation

@kshahbw
Copy link
Copy Markdown

@kshahbw kshahbw commented Mar 27, 2026

Summary

  • Adds Express Registration API (createRegistration, sendVerificationCode, verifyRegistrationCode) to the MCP server
  • Supports no-auth APIs via requires_auth flag on _create_server — Express requires no authentication
  • Makes startup credentials optional — server starts without BW_USERNAME/BW_PASSWORD, Express tools are available immediately
  • Adds setCredentials tool so agents can inject credentials mid-session after Express registration, triggering loading of authenticated API servers
  • Renames Express verifyCodeverifyRegistrationCode to avoid operationId collision with MFA's verifyCode

Changes

  • src/servers.py: Added requires_auth param, Express in api_server_info, explicit credential check
  • src/config.py: Credentials now optional (warns instead of raising)
  • src/app.py: Reload callback for post-registration credential injection
  • src/tools/credentials.py: setCredentials tool with idempotency guard
  • test/fixtures/express.yml: Express OpenAPI spec fixture (3 endpoints)
  • test/test_express.py: 5 Express-specific tests
  • test/test_config.py: Optional credentials tests
  • test/test_credentials.py: setCredentials tool tests
  • test/test_servers.py: Updated tool count (50), added express mock
  • README.md: Express Registration docs + tool filtering example

Test plan

  • All 21 tests pass (12 existing + 9 new, no regressions)
  • Express server creates 3 tools with correct operation IDs
  • Express server works without auth credentials (no Authorization header)
  • Tool parameter schemas include required fields
  • Config loads without credentials (warns, doesn't crash)
  • setCredentials updates config and triggers reload callback
  • Verify Express spec URL resolves after API branch merge (blocked until launch)

🤖 Generated with Claude Code

kshahbw and others added 8 commits March 27, 2026 00:52
Adds requires_auth parameter to _create_server, registers Express Registration API (no-auth) in api_server_info, and adds Express-specific tests. Total tool count updated to 49 (Express adds 2 net new tools; verifyCode deduplicates with MFA).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… collision

The Express and MFA APIs both had operationId: verifyCode, causing FastMCP
to silently drop one during import. Renamed to verifyRegistrationCode so
all 50 tools are accessible.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ntials tool

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…fidelity

- Add idempotency guard to _reload_authenticated_servers (prevents tool
  duplication on repeated setCredentials calls)
- Fix mutable default config={} in _create_server and create_bandwidth_mcp
- Fix Express tests to use requires_auth=False (matches production config)
- Move warnings import to top of config.py

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kshahbw kshahbw requested review from a team as code owners March 27, 2026 05:18
@bwappsec
Copy link
Copy Markdown

bwappsec commented Mar 27, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@kshahbw kshahbw changed the title feat: add Express Registration API + zero-to-one auth flow SWI-10226 feat: add Express Registration API + zero-to-one auth flow Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants