Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion core/commands/slash/mcpSlashCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ export function stringifyMcpPrompt(
let stringified = "";
for (const message of messages) {
if (message.content.type === "text") {
stringified += `<${message.content.role}/>\n${message.content.text}\n<${message.content.role}/>`;
const role =
"role" in message.content && typeof message.content.role === "string"
? message.content.role
: message.content._meta &&
"role" in message.content._meta &&
typeof message.content._meta.role === "string"
? message.content._meta.role
: "assistant";
stringified += `<${role}/>\n${message.content.text}\n<${role}/>`;
} else {
console.warn(
`MCP Prompt conversion warning: ${message.content.type} content is not yet supported, message skipped`,
Expand Down
6 changes: 2 additions & 4 deletions core/context/providers/MCPContextProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,15 @@ class MCPContextProvider extends BaseContextProvider {

return await Promise.all(
contents.map(async (resource) => {
const content = resource.text;
if (typeof content !== "string") {
if (!("text" in resource) || typeof resource.text !== "string") {
throw new Error(
"Continue currently only supports text resources from MCP",
);
}

return {
name: resource.uri,
description: resource.uri,
content,
content: resource.text,
uri: {
type: "url",
value: resource.uri,
Expand Down
138 changes: 125 additions & 13 deletions core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"@continuedev/llm-info": "file:../packages/llm-info",
"@continuedev/openai-adapters": "file:../packages/openai-adapters",
"@continuedev/terminal-security": "file:../packages/terminal-security",
"@modelcontextprotocol/sdk": "^1.12.0",
"@modelcontextprotocol/sdk": "^1.24.0",
"@mozilla/readability": "^0.5.0",
"@octokit/rest": "^20.1.1",
"@sentry/cli": "^2.50.2",
Expand Down
Loading
Loading