Skip to content

Commit 254d689

Browse files
tylergibbs1claude
andauthored
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

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ dist/
55
.DS_Store
66
*.log
77
.breadcrumbs.json
8-
examples/test-models.json
9-
examples/test-todo.ts
8+
**/test-models.json
9+
**/test-todo.ts

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,10 +522,20 @@ try {
522522
}
523523
```
524524

525+
## Packages
526+
527+
Stratus is a monorepo with two packages:
528+
529+
| Package | Description |
530+
|---|---|
531+
| [`stratus-sdk`](packages/stratus-sdk/) | Agent SDK for Azure OpenAI (this README) |
532+
| [`@stratus/mcp-aws`](packages/mcp-aws/) | MCP server framework for AWS — deploy MCP servers to Lambda with progressive disclosure, tool gating, and code mode |
533+
525534
## Development
526535

527536
```bash
528-
bun test # Run tests
537+
bun install # Install all workspace dependencies
538+
bun test # Run tests (all packages)
529539
bun run lint # Lint with Biome
530540
bun run typecheck # TypeScript type checking
531541
```

bun.lock

Lines changed: 443 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,15 @@
11
{
2-
"name": "stratus-sdk",
3-
"version": "0.11.0",
4-
"type": "module",
5-
"main": "./dist/index.js",
6-
"types": "./dist/index.d.ts",
7-
"exports": {
8-
".": {
9-
"types": "./dist/index.d.ts",
10-
"import": "./dist/index.js"
11-
},
12-
"./core": {
13-
"types": "./dist/core/index.d.ts",
14-
"import": "./dist/core/index.js"
15-
},
16-
"./azure": {
17-
"types": "./dist/azure/index.d.ts",
18-
"import": "./dist/azure/index.js"
19-
}
20-
},
21-
"keywords": ["azure", "openai", "agent", "ai", "llm", "typescript", "tools", "streaming"],
22-
"files": ["dist", "README.md"],
23-
"scripts": {
24-
"build": "tsc -p tsconfig.build.json",
25-
"typecheck": "tsc --noEmit",
26-
"lint": "biome check .",
27-
"lint:fix": "biome check --write .",
28-
"test": "bun test"
29-
},
30-
"peerDependencies": {
31-
"zod": "^4.0.0"
32-
},
33-
"devDependencies": {
34-
"@biomejs/biome": "^1.9.0",
35-
"@types/bun": "^1.3.9",
36-
"typescript": "^5.6.0",
37-
"zod": "^4.0.0"
38-
}
2+
"private": true,
3+
"workspaces": ["packages/*"],
4+
"scripts": {
5+
"lint": "biome check .",
6+
"lint:fix": "biome check --write .",
7+
"test": "bun run --filter '*' test",
8+
"build": "bun run --filter '*' build"
9+
},
10+
"devDependencies": {
11+
"@biomejs/biome": "^1.9.0",
12+
"@types/bun": "^1.3.9",
13+
"typescript": "^5.6.0"
14+
}
3915
}

0 commit comments

Comments
 (0)