Commit 254d689
Add @stratus/mcp-aws — MCP server framework for AWS (#1)
* Add @stratus/mcp-aws — MCP server framework for AWS
Convert to Bun workspaces monorepo and add @stratus/mcp-aws (v0.1.0),
a TypeScript library for building, deploying, and managing MCP servers
on AWS.
**Monorepo conversion:**
- Move stratus-sdk into packages/stratus-sdk/ (renames preserved)
- Root package.json with workspaces config
- Shared tsconfig.base.json, biome stays at root
- Hoisted devDeps (biome, typescript, @types/bun)
**@stratus/mcp-aws features (M1+M2+M3 of PRD):**
- McpServer with Vercel-level DX: `new McpServer("name@1.0")`
- Tool registration: 3 overloads, auto-coerced returns (string/object/array)
- Progressive disclosure: always/discoverable/hidden tiers, BM25 search,
tools/list_changed notifications, session-scoped visibility
- Tool gating: role(), requires(), check(), rateLimit(), all(), any()
with structured denial errors and prerequisite workflow enforcement
- Code mode: execute_workflow meta-tool, WorkerExecutor isolation,
gate pre-validation, code-first disclosure mode
- Auth: apiKey(), cognito() factories, chainable, AsyncLocalStorage context
- Deploy: server.deploy() → Lambda + Function URL + IAM in ~20s
with VPC, AWS_IAM, and private-only security modes
- Transports: server.lambda(), server.express(), server.bun(), server.stdio()
- Sessions: MemorySessionStore, DynamoSessionStore, SqliteSessionStore
- Observability: typed events (tool:call, tool:result, gate:denied, etc.)
- Security: SSRF protection, RFC 9728 OAuth metadata, WWW-Authenticate
- Composition: codeMcpServer(), createMcpHandler()
**Tests:** 258 local tests (<1s), plus AWS integration tests that deploy
real Lambda functions and verify resources via AWS CLI.
**Tested end-to-end:** Stratus agent → Azure OpenAI → deployed MCP server
on Lambda → tool execution → response back to agent.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix all 7 Copilot review comments
1. normalizeToolResult: remove Promise from param type (callers always await)
2. SSRF: tighten /^fd/i to /^fd[0-9a-f]{2}:/i (was matching fdic.gov)
3. createMcpHandler: accept factory function, create fresh server per request
4. Bun transport test: randomize ports to avoid CI flakes
5. Rename stdio-roundtrip.test.ts → mcp-protocol-roundtrip.test.ts
6. Async gates default to deny (was conservatively promoting — security fix)
7. codeMcpServer: detect sanitizeToolName collisions, throw on conflict
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix DynamoDB serialization crash + add full AWS E2E test
- Fix: DynamoDB session store crashed on AbortSignal in toolCallHistory
params. Added safeClone() to strip non-serializable values before
DynamoDB put.
- Fix: Lambda handler now saves session AFTER request processing so
promoted tools and gate unlocks persist across requests.
- Fix: Bun.serve() uses globalThis.Bun to avoid crash when bundled
for Node.js Lambda.
- Add: deploy config `policies` option for additional IAM policies
(needed for DynamoDB access).
- Add: Full AWS E2E test (17 tests) covering auth, progressive
disclosure, gate denial, code mode, DynamoDB session persistence,
and basic tool calls — all on real deployed Lambda.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 2a9eab8 commit 254d689
160 files changed
Lines changed: 10743 additions & 68 deletions
File tree
- packages
- mcp-aws
- examples
- src
- auth
- codemode
- disclosure
- gating
- session
- tests
- auth
- codemode
- disclosure
- gating
- integration
- session
- stratus-sdk
- examples
- src
- azure
- core
- codemode
- utils
- tests
- azure
- core
- integration
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
525 | 534 | | |
526 | 535 | | |
527 | 536 | | |
528 | | - | |
| 537 | + | |
| 538 | + | |
529 | 539 | | |
530 | 540 | | |
531 | 541 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
39 | 15 | | |
0 commit comments