You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(mcp): Add optional visibility parameter to control chat visibility (#903)
* Add optional visibility parameter to MCP ask_codebase tool
- Add visibility parameter to askCodebaseRequestSchema in MCP
- Update blocking chat API to accept and use visibility parameter
- Allow agents to override default visibility (PRIVATE/PUBLIC)
- Useful for shared environments like Slack where links should be public
Co-authored-by: Brendan Kellam <brendan@sourcebot.dev>
* Update CHANGELOG entries for PR #903
- Add entry to main CHANGELOG.md
- Add entry to packages/mcp/CHANGELOG.md
Co-authored-by: Brendan Kellam <brendan@sourcebot.dev>
* Update CHANGELOG to mention /api/chat/blocking endpoint
- Clarify that the change affects both the API endpoint and MCP tool
Co-authored-by: Brendan Kellam <brendan@sourcebot.dev>
* Prevent anonymous users from creating PRIVATE chats
- Update visibility logic to ignore PRIVATE requests from unauthenticated users
- Add guard to ensure anonymous users can only create PUBLIC chats
- Update tool description and schema to document this behavior
- Prevents creation of inaccessible ownerless private chats
Co-authored-by: Brendan Kellam <brendan@sourcebot.dev>
* Move anonymous user restriction note to API route description
- Remove note from MCP tool descriptions (schemas.ts and index.ts)
- Add note to blocking chat API route's visibility parameter description
- Clarifies that the restriction is enforced at the API level
Co-authored-by: Brendan Kellam <brendan@sourcebot.dev>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Copy file name to clipboardExpand all lines: packages/mcp/src/index.ts
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -416,6 +416,8 @@ server.tool(
416
416
417
417
Returns a detailed answer in markdown format with code references, plus a link to view the full research session (including all tool calls and reasoning) in the Sourcebot web UI.
418
418
419
+
When using this in shared environments (e.g., Slack), you can set the visibility parameter to 'PUBLIC' to ensure everyone can access the chat link.
420
+
419
421
This is a blocking operation that may take 30-60+ seconds for complex questions as the agent researches the codebase.
.describe("The language model to use for answering the question. If not provided, defaults to the first model in the config. Use list_language_models to see available options."),
384
+
visibility: z
385
+
.enum(['PRIVATE','PUBLIC'])
386
+
.optional()
387
+
.describe("The visibility of the chat session. If not provided, defaults to PRIVATE for authenticated users and PUBLIC for anonymous users. Set to PUBLIC to make the chat viewable by anyone with the link."),
.describe("The language model to use for the chat. If not provided, the first configured model is used."),
36
+
visibility: z
37
+
.nativeEnum(ChatVisibility)
38
+
.optional()
39
+
.describe("The visibility of the chat session. If not provided, defaults to PRIVATE for authenticated users and PUBLIC for anonymous users. Set to PUBLIC to make the chat viewable by anyone with the link. Note: Anonymous users cannot create PRIVATE chats; any PRIVATE request from an unauthenticated user will be ignored and set to PUBLIC."),
0 commit comments