Skip to content

Commit 8106033

Browse files
Merge branch 'main' into bkellam/agent-improvements
2 parents f4ef924 + e29056b commit 8106033

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [4.15.9] - 2026-03-17
11+
12+
### Added
13+
- Added read-only annotations to MCP tools for compatibility with Cursor Ask mode and other MCP clients that restrict tool usage based on behavior hints. [#1013](https://github.com/sourcebot-dev/sourcebot/pull/1013)
14+
1015
## [4.15.8] - 2026-03-17
1116

1217
### Added

docs/api-reference/sourcebot-public.openapi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.0.3",
33
"info": {
44
"title": "Sourcebot Public API",
5-
"version": "v4.15.8",
5+
"version": "v4.15.9",
66
"description": "OpenAPI description for the public Sourcebot REST endpoints used for search, repository listing, and file browsing."
77
},
88
"tags": [

packages/mcp/src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ server.tool(
6969
.transform((val) => (val < env.DEFAULT_MINIMUM_TOKENS ? env.DEFAULT_MINIMUM_TOKENS : val))
7070
.optional(),
7171
},
72+
{ readOnlyHint: true },
7273
async ({
7374
query,
7475
filterByRepos: repos = [],
@@ -186,6 +187,7 @@ server.tool(
186187
"list_commits",
187188
dedent`Get a list of commits for a given repository.`,
188189
listCommitsQueryParamsSchema.shape,
190+
{ readOnlyHint: true },
189191
async (request: ListCommitsQueryParamsSchema) => {
190192
const result = await listCommits(request);
191193

@@ -201,6 +203,7 @@ server.tool(
201203
"list_repos",
202204
dedent`Lists repositories in the organization with optional filtering and pagination.`,
203205
listReposQueryParamsSchema.shape,
206+
{ readOnlyHint: true },
204207
async (request: ListReposQueryParams) => {
205208
const result = await listRepos(request);
206209

@@ -226,6 +229,7 @@ server.tool(
226229
"read_file",
227230
dedent`Reads the source code for a given file.`,
228231
fileSourceRequestSchema.shape,
232+
{ readOnlyHint: true },
229233
async (request: FileSourceRequest) => {
230234
const response = await getFileSource(request);
231235

@@ -249,6 +253,7 @@ server.tool(
249253
Returns a flat list of entries with path metadata and depth relative to the requested path.
250254
`,
251255
listTreeRequestSchema.shape,
256+
{ readOnlyHint: true },
252257
async ({
253258
repo,
254259
path = '',
@@ -395,6 +400,7 @@ server.tool(
395400
"list_language_models",
396401
dedent`Lists the available language models configured on the Sourcebot instance. Use this to discover which models can be specified when calling ask_codebase.`,
397402
{},
403+
{ readOnlyHint: true },
398404
async () => {
399405
const models = await listLanguageModels();
400406

@@ -424,6 +430,7 @@ server.tool(
424430
This is a blocking operation that may take 30-60+ seconds for complex questions as the agent researches the codebase.
425431
`,
426432
askCodebaseRequestSchema.shape,
433+
{ readOnlyHint: true },
427434
async (request: AskCodebaseRequest) => {
428435
const response = await askCodebase(request);
429436

packages/shared/src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// This file is auto-generated by .github/workflows/release-sourcebot.yml
2-
export const SOURCEBOT_VERSION = "v4.15.8";
2+
export const SOURCEBOT_VERSION = "v4.15.9";

packages/web/src/features/mcp/server.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ export function createMcpServer(): McpServer {
2929
"list_language_models",
3030
{
3131
description: dedent`Lists the available language models configured on the Sourcebot instance. Use this to discover which models can be specified when calling ask_codebase.`,
32+
annotations: {
33+
readOnlyHint: true,
34+
idempotentHint: true,
35+
}
3236
},
3337
async () => {
3438
const models = await getConfiguredLanguageModelsInfo();
@@ -61,6 +65,9 @@ export function createMcpServer(): McpServer {
6165
languageModel: languageModelInfoSchema.optional().describe("The language model to use. If not provided, defaults to the first model in the config."),
6266
visibility: z.enum(['PRIVATE', 'PUBLIC']).optional().describe("The visibility of the chat session. Defaults to PRIVATE for authenticated users."),
6367
}),
68+
annotations: {
69+
readOnlyHint: true,
70+
}
6471
},
6572
async (request) => {
6673
const result = await askCodebase({

0 commit comments

Comments
 (0)