Skip to content

Commit 5341371

Browse files
aadesh18mantrakp04claudeN2D4
authored
LLM MCP Flow (#1321)
<!-- Make sure you've read the CONTRIBUTING.md guidelines: https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Automated AI QA review pipeline and human-verified knowledge base consulted first * Internal MCP review tool: call log viewer, conversation replay, add/edit/publish Q&A, knowledge editor, and analytics * Docs search now preserves follow-up conversation context * **Documentation** * Added “Ask DeepWiki” badge to README * **Chores** * Added local SpacetimeDB background service and internal-tool app scaffolding <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: mantrakp04 <mantrakp@gmail.com> Co-authored-by: Mantra <87142457+mantrakp04@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
1 parent c5436be commit 5341371

82 files changed

Lines changed: 5149 additions & 121 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.

.github/workflows/db-migration-backwards-compatibility.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ jobs:
138138
- name: Create .env.test.local file for examples/convex
139139
run: cp examples/convex/.env.development examples/convex/.env.test.local
140140

141+
- name: Create .env.test.local file for apps/internal-tool
142+
run: cp apps/internal-tool/.env.development apps/internal-tool/.env.test.local
143+
141144
- name: Build
142145
run: pnpm build
143146

@@ -332,6 +335,9 @@ jobs:
332335
- name: Create .env.test.local file for examples/convex
333336
run: cp examples/convex/.env.development examples/convex/.env.test.local
334337

338+
- name: Create .env.test.local file for apps/internal-tool
339+
run: cp apps/internal-tool/.env.development apps/internal-tool/.env.test.local
340+
335341
- name: Build
336342
run: pnpm build
337343

.github/workflows/e2e-api-tests-local-emulator.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ jobs:
8686
- name: Create .env.test.local file for examples/convex
8787
run: cp examples/convex/.env.development examples/convex/.env.test.local
8888

89+
- name: Create .env.test.local file for apps/internal-tool
90+
run: cp apps/internal-tool/.env.development apps/internal-tool/.env.test.local
91+
8992
- name: Build
9093
run: pnpm build
9194

.github/workflows/e2e-api-tests.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ jobs:
9292
- name: Create .env.test.local file for examples/convex
9393
run: cp examples/convex/.env.development examples/convex/.env.test.local
9494

95+
- name: Create .env.test.local file for apps/internal-tool
96+
run: cp apps/internal-tool/.env.development apps/internal-tool/.env.test.local
97+
9598
- name: Build
9699
run: pnpm build
97100

.github/workflows/e2e-custom-base-port-api-tests.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ jobs:
8585
- name: Create .env.test.local file for examples/convex
8686
run: cp examples/convex/.env.development examples/convex/.env.test.local
8787

88+
- name: Create .env.test.local file for apps/internal-tool
89+
run: cp apps/internal-tool/.env.development apps/internal-tool/.env.test.local
90+
8891
- name: Build
8992
run: pnpm build
9093

.github/workflows/e2e-fallback-tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ jobs:
6868
cp examples/middleware/.env.development examples/middleware/.env.test.local
6969
cp examples/supabase/.env.development examples/supabase/.env.test.local
7070
cp examples/convex/.env.development examples/convex/.env.test.local
71+
cp apps/internal-tool/.env.development apps/internal-tool/.env.test.local
7172
7273
- name: Build
7374
run: pnpm build

.github/workflows/lint-and-build.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ jobs:
6666
- name: Create .env.production.local file for examples/convex
6767
run: cp examples/convex/.env.development examples/convex/.env.production.local
6868

69+
- name: Create .env.production.local file for apps/internal-tool
70+
run: cp apps/internal-tool/.env.development apps/internal-tool/.env.production.local
71+
6972
- name: Build
7073
run: pnpm build
7174

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[![Stack Logo](/.github/assets/logo.png)](https://stack-auth.com)
22

3+
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/stack-auth/stack-auth)
4+
35
<h3 align="center">
46
<a href="https://docs.stack-auth.com">📘 Docs</a>
57
| <a href="https://stack-auth.com/">☁️ Hosted Version</a>

apps/backend/.env

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,8 @@ STACK_TELEGRAM_CHAT_ID=# enter your telegram chat id
118118

119119
# Docs AI tool bundle
120120
STACK_DOCS_INTERNAL_BASE_URL=# override the docs origin used by the backend's AI tool bundle to call the docs app's `/api/internal/docs-tools` endpoint. Defaults to http://localhost:${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}04 in dev, https://mcp.stack-auth.com in prod
121+
122+
# MCP review tool (SpacetimeDB)
123+
STACK_SPACETIMEDB_URI=# SpacetimeDB host URI; default empty (logging disabled)
124+
STACK_SPACETIMEDB_DB_NAME=# SpacetimeDB database name
125+
STACK_MCP_LOG_TOKEN=# shared secret gating the log_mcp_call reducer; must match EXPECTED_LOG_TOKEN in apps/internal-tool/spacetimedb/src/index.ts

apps/backend/.env.development

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ STACK_QSTASH_TOKEN=eyJVc2VySUQiOiJkZWZhdWx0VXNlciIsIlBhc3N3b3JkIjoiZGVmYXVsdFBhc
113113
STACK_QSTASH_CURRENT_SIGNING_KEY=sig_7kYjw48mhY7kAjqNGcy6cr29RJ6r
114114
STACK_QSTASH_NEXT_SIGNING_KEY=sig_5ZB6DVzB1wjE8S6rZ7eenA8Pdnhs
115115

116+
# MCP review tool (SpacetimeDB)
117+
STACK_SPACETIMEDB_URI=ws://localhost:${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}39
118+
STACK_SPACETIMEDB_DB_NAME=stack-auth-llm
119+
STACK_MCP_LOG_TOKEN=change-me
120+
116121
# Clickhouse
117122
STACK_CLICKHOUSE_URL=http://localhost:${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}36
118123
STACK_CLICKHOUSE_ADMIN_USER=stackframe

apps/backend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
},
5656
"dependencies": {
5757
"@ai-sdk/mcp": "^1.0.21",
58+
"spacetimedb": "^2.1.0",
5859
"@ai-sdk/openai": "^3.0.29",
5960
"@aws-sdk/client-s3": "^3.855.0",
6061
"@clickhouse/client": "^1.14.0",

0 commit comments

Comments
 (0)