Skip to content

Commit 80a33ef

Browse files
authored
chore: mcp 1.24.0 (#8974)
* chore: bump mcp * chore: update mcp * fix: linting
1 parent 7927491 commit 80a33ef

File tree

7 files changed

+281
-72
lines changed

7 files changed

+281
-72
lines changed

core/commands/slash/mcpSlashCommand.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@ export function stringifyMcpPrompt(
2323
let stringified = "";
2424
for (const message of messages) {
2525
if (message.content.type === "text") {
26-
stringified += `<${message.content.role}/>\n${message.content.text}\n<${message.content.role}/>`;
26+
const role =
27+
"role" in message.content && typeof message.content.role === "string"
28+
? message.content.role
29+
: message.content._meta &&
30+
"role" in message.content._meta &&
31+
typeof message.content._meta.role === "string"
32+
? message.content._meta.role
33+
: "assistant";
34+
stringified += `<${role}/>\n${message.content.text}\n<${role}/>`;
2735
} else {
2836
console.warn(
2937
`MCP Prompt conversion warning: ${message.content.type} content is not yet supported, message skipped`,

core/context/providers/MCPContextProvider.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,15 @@ class MCPContextProvider extends BaseContextProvider {
8080

8181
return await Promise.all(
8282
contents.map(async (resource) => {
83-
const content = resource.text;
84-
if (typeof content !== "string") {
83+
if (!("text" in resource) || typeof resource.text !== "string") {
8584
throw new Error(
8685
"Continue currently only supports text resources from MCP",
8786
);
8887
}
89-
9088
return {
9189
name: resource.uri,
9290
description: resource.uri,
93-
content,
91+
content: resource.text,
9492
uri: {
9593
type: "url",
9694
value: resource.uri,

core/package-lock.json

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

core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"@continuedev/llm-info": "file:../packages/llm-info",
6565
"@continuedev/openai-adapters": "file:../packages/openai-adapters",
6666
"@continuedev/terminal-security": "file:../packages/terminal-security",
67-
"@modelcontextprotocol/sdk": "^1.12.0",
67+
"@modelcontextprotocol/sdk": "^1.24.0",
6868
"@mozilla/readability": "^0.5.0",
6969
"@octokit/rest": "^20.1.1",
7070
"@sentry/cli": "^2.50.2",

0 commit comments

Comments
 (0)