-
Notifications
You must be signed in to change notification settings - Fork 287
ask mcp integration #1209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
ask mcp integration #1209
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
07c1908
Add ask MCP server integration
jsourcebot 48b4448
Merge MCP user server credentials
jsourcebot c357e62
Inject Prisma into MCP OAuth provider
jsourcebot 1e3fdc1
Scope MCP user server queries
jsourcebot da3f885
Add org-approved MCP servers
jsourcebot acda402
feat(web): add workspace MCP configuration
jsourcebot ffe0d87
fix(web): allow MCP cleanup without OAuth entitlement
jsourcebot 1e6860b
feat(web): improve MCP server add flow
jsourcebot d193ce6
fix(web): check DCR for prefab MCP servers
jsourcebot 820ecb3
feat(web): support static OAuth MCP credentials
jsourcebot 95e2d95
feat(web): add more prefab MCP servers
jsourcebot e71e25f
fix(web): use official Atlassian MCP icons
jsourcebot d7e1e7d
fix(web): use Atlassian prefab MCP server
jsourcebot 0abe155
feat(web): connect approved MCP servers from chat
jsourcebot 4d1bcfc
feat(web): redesign MCP servers settings page
jsourcebot 78cd0f0
Rename MCP settings to Ask Agent connectors
jsourcebot c0e9225
feat(web): redesign workspace Ask Agent settings page
jsourcebot 29edd6c
feat(web): add workspace connector config link to chat toolbar
jsourcebot 49d5906
Add MCP connector tool metadata
jsourcebot ff6fb0f
feat(web): redesign MCP tools list as compact clickable badges
jsourcebot 33e7785
refactor(web): extract shared ConnectorCard component
jsourcebot 0c72b28
Fix Ask approval turn progress state
jsourcebot 289bf5c
Add MCP connector usage counters
jsourcebot 5fc2fc8
Address MCP review feedback
jsourcebot 25dae4e
Remove workspace Ask Agent connector summary cards
jsourcebot f358378
Add PostHog prefab MCP server
jsourcebot 6d336f7
Add Ask MCP PostHog metrics
jsourcebot 0bebd3b
Add Ask MCP tool call analytics
jsourcebot a62a615
Add Ask MCP connector lifecycle analytics
jsourcebot 1d62399
Fix v5 rebase follow-ups
jsourcebot 8903390
Clean up Ask MCP deployment references
jsourcebot 209da4d
Move EE MCP feature under chat
jsourcebot 71c2893
Simplify static MCP OAuth HTTPS guard
jsourcebot 9c15807
docs: v5 docs updates (#1244)
msukkari 6739694
[v5] feat(web): Add usage information for yearly subs (#1245)
brendan-kellam 3d00a39
fix build errors after merge
msukkari 2c34b08
fix bug where Ask doesn't load if we dont have a license key
msukkari a7088e8
refactor(web): clean up MCP OAuth provider
jsourcebot 0c6ab64
Merge branch 'v5' into BlueBottleLatte/askmcp
brendan-kellam 41b9f04
Merge branch 'BlueBottleLatte/askmcp' of https://github.com/sourcebot…
jsourcebot 7deb050
Prisma Migrations
jsourcebot c2e7885
Merge branch 'v5' into BlueBottleLatte/askmcp
brendan-kellam 7833a07
Address various review feedback
jsourcebot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
packages/db/prisma/migrations/20260529214711_add_mcp_connectors_tables/migration.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| -- CreateEnum | ||
| CREATE TYPE "McpServerClientInfoSource" AS ENUM ('DYNAMIC', 'STATIC'); | ||
|
|
||
| -- CreateTable | ||
| CREATE TABLE "McpServer" ( | ||
| "id" TEXT NOT NULL, | ||
| "name" TEXT NOT NULL, | ||
| "sanitizedName" TEXT NOT NULL, | ||
| "serverUrl" TEXT NOT NULL, | ||
| "clientInfo" TEXT, | ||
| "clientInfoSource" "McpServerClientInfoSource" NOT NULL DEFAULT 'DYNAMIC', | ||
| "orgId" INTEGER NOT NULL, | ||
| "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
| "updatedAt" TIMESTAMP(3) NOT NULL, | ||
|
|
||
| CONSTRAINT "McpServer_pkey" PRIMARY KEY ("id") | ||
| ); | ||
|
|
||
| -- CreateTable | ||
| CREATE TABLE "McpServerToolCallCount" ( | ||
| "mcpServerId" TEXT NOT NULL, | ||
| "toolName" TEXT NOT NULL, | ||
| "count" INTEGER NOT NULL DEFAULT 0, | ||
| "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
| "updatedAt" TIMESTAMP(3) NOT NULL, | ||
|
|
||
| CONSTRAINT "McpServerToolCallCount_pkey" PRIMARY KEY ("mcpServerId","toolName") | ||
| ); | ||
|
|
||
| -- CreateTable | ||
| CREATE TABLE "UserMcpServer" ( | ||
| "userId" TEXT NOT NULL, | ||
| "serverId" TEXT NOT NULL, | ||
| "tokens" TEXT, | ||
| "tokensExpiresAt" TIMESTAMP(3), | ||
| "codeVerifier" TEXT, | ||
| "state" TEXT, | ||
| "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
| "updatedAt" TIMESTAMP(3) NOT NULL, | ||
|
|
||
| CONSTRAINT "UserMcpServer_pkey" PRIMARY KEY ("userId","serverId") | ||
| ); | ||
|
|
||
| -- CreateIndex | ||
| CREATE UNIQUE INDEX "McpServer_serverUrl_orgId_key" ON "McpServer"("serverUrl", "orgId"); | ||
|
|
||
| -- CreateIndex | ||
| CREATE UNIQUE INDEX "McpServer_orgId_sanitizedName_key" ON "McpServer"("orgId", "sanitizedName"); | ||
|
|
||
| -- CreateIndex | ||
| CREATE INDEX "UserMcpServer_serverId_idx" ON "UserMcpServer"("serverId"); | ||
|
|
||
| -- CreateIndex | ||
| CREATE INDEX "UserMcpServer_state_idx" ON "UserMcpServer"("state"); | ||
|
|
||
| -- AddForeignKey | ||
| ALTER TABLE "McpServer" ADD CONSTRAINT "McpServer_orgId_fkey" FOREIGN KEY ("orgId") REFERENCES "Org"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
|
||
| -- AddForeignKey | ||
| ALTER TABLE "McpServerToolCallCount" ADD CONSTRAINT "McpServerToolCallCount_mcpServerId_fkey" FOREIGN KEY ("mcpServerId") REFERENCES "McpServer"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
|
||
| -- AddForeignKey | ||
| ALTER TABLE "UserMcpServer" ADD CONSTRAINT "UserMcpServer_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
|
||
| -- AddForeignKey | ||
| ALTER TABLE "UserMcpServer" ADD CONSTRAINT "UserMcpServer_serverId_fkey" FOREIGN KEY ("serverId") REFERENCES "McpServer"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -339,4 +339,4 @@ const AppearanceDropdownMenuGroup = () => { | |
| </DropdownMenuSub> | ||
| </DropdownMenuGroup> | ||
| ) | ||
| } | ||
| } | ||
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
89 changes: 89 additions & 0 deletions
89
packages/web/src/app/(app)/chat/[id]/components/chatThreadPanel.test.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| import { cleanup, render, waitFor } from '@testing-library/react'; | ||
| import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'; | ||
| import { SET_CHAT_STATE_SESSION_STORAGE_KEY } from '@/features/chat/constants'; | ||
| import { ChatThreadPanel } from './chatThreadPanel'; | ||
|
|
||
| const { chatThreadProps } = vi.hoisted(() => ({ | ||
| chatThreadProps: [] as Array<{ disabledMcpServerIds?: unknown }>, | ||
| })); | ||
|
|
||
| vi.mock('next/navigation', () => ({ | ||
| useParams: () => ({ id: 'chat-1' }), | ||
| })); | ||
|
|
||
| vi.mock('@/features/chat/components/chatThread', () => ({ | ||
| ChatThread: (props: { disabledMcpServerIds?: unknown }) => { | ||
| chatThreadProps.push(props); | ||
| return <div data-testid="chat-thread" />; | ||
| }, | ||
| })); | ||
|
|
||
| function createMockStorage(): Storage { | ||
| const store = new Map<string, string>(); | ||
|
|
||
| return { | ||
| get length() { | ||
| return store.size; | ||
| }, | ||
| clear: () => store.clear(), | ||
| getItem: (key: string) => store.get(key) ?? null, | ||
| key: (index: number) => Array.from(store.keys())[index] ?? null, | ||
| removeItem: (key: string) => { | ||
| store.delete(key); | ||
| }, | ||
| setItem: (key: string, value: string) => { | ||
| store.set(key, value); | ||
| }, | ||
| }; | ||
| } | ||
|
|
||
| function installMockStorage(key: 'localStorage' | 'sessionStorage') { | ||
| const storage = createMockStorage(); | ||
| Object.defineProperty(window, key, { | ||
| configurable: true, | ||
| value: storage, | ||
| }); | ||
| Object.defineProperty(globalThis, key, { | ||
| configurable: true, | ||
| value: storage, | ||
| }); | ||
| } | ||
|
|
||
| describe('ChatThreadPanel', () => { | ||
| beforeEach(() => { | ||
| installMockStorage('localStorage'); | ||
| installMockStorage('sessionStorage'); | ||
| chatThreadProps.length = 0; | ||
| sessionStorage.clear(); | ||
| }); | ||
|
|
||
| afterEach(() => { | ||
| cleanup(); | ||
| sessionStorage.clear(); | ||
| }); | ||
|
|
||
| test('defaults restored disabled MCP server ids to an empty array when missing from session storage', async () => { | ||
| sessionStorage.setItem(SET_CHAT_STATE_SESSION_STORAGE_KEY, JSON.stringify({ | ||
| inputMessage: { | ||
| role: 'user', | ||
| parts: [{ type: 'text', text: 'hello' }], | ||
| }, | ||
| selectedSearchScopes: [], | ||
| })); | ||
|
|
||
| render( | ||
| <ChatThreadPanel | ||
| languageModels={[]} | ||
| repos={[]} | ||
| searchContexts={[]} | ||
| messages={[]} | ||
| isOwner={true} | ||
| isAuthenticated={true} | ||
| /> | ||
| ); | ||
|
|
||
| await waitFor(() => expect(chatThreadProps.length).toBeGreaterThan(1)); | ||
|
|
||
| expect(chatThreadProps.at(-1)?.disabledMcpServerIds).toEqual([]); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.