-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fix: Check for MCP Available Attributes #3232
Fix: Check for MCP Available Attributes #3232
Conversation
✅ Deploy Preview for continuedev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
To handle duplicate tools, an easy fix would just be to encode the BuiltinTools using some sort of prefix: export enum BuiltInToolNames {
ReadFile = "builtin_read_file",
ReadCurrentlyOpenFile = "builtin_read_currently_open_file",
CreateNewFile = "builtin_create_new_file",
RunTerminalCommand = "builtin_run_terminal_command",
ViewSubdirectory = "builtin_view_subdirectory",
ViewRepoMap = "builtin_view_repo_map",
ExactSearch = "builtin_exact_search",
SearchWeb = "builtin_search_web",
ViewDiff = "builtin_view_diff",
} |
@sestinj @Patrick-Erichsen This is ready for review! |
I tried to get this to work on my end, could you confirm my {
"models": [
{
"title": "Claude 3.5 Sonnet (Free Trial)",
"provider": "free-trial",
"model": "claude-3-5-sonnet-latest",
"systemMessage": "You are an expert software developer. You give helpful and concise responses."
},
{
"title": "GPT-4o (Free Trial)",
"provider": "free-trial",
"model": "gpt-4o",
"systemMessage": "You are an expert software developer. You give helpful and concise responses."
},
{
"title": "Llama3.1 70b (Free Trial)",
"provider": "free-trial",
"model": "llama3.1-70b",
"systemMessage": "You are an expert software developer. You give helpful and concise responses."
},
{
"title": "Codestral (Free Trial)",
"provider": "free-trial",
"model": "codestral-latest",
"systemMessage": "You are an expert software developer. You give helpful and concise responses."
},
{
"model": "claude-3-5-sonnet-latest",
"provider": "anthropic",
"apiKey": "",
"title": "Claude 3.5 Sonnet"
}
],
"tabAutocompleteModel": {
"title": "Tab Autocomplete",
"provider": "free-trial",
"model": "codestral-latest"
},
"customCommands": [
{
"name": "test",
"prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
"description": "Write unit tests for highlighted code"
}
],
"contextProviders": [
{
"name": "code",
"params": {}
},
{
"name": "docs",
"params": {}
},
{
"name": "diff",
"params": {}
},
{
"name": "terminal",
"params": {}
},
{
"name": "problems",
"params": {}
},
{
"name": "folder",
"params": {}
},
{
"name": "codebase",
"params": {}
}
],
"slashCommands": [
{
"name": "share",
"description": "Export the current chat session to markdown"
},
{
"name": "cmd",
"description": "Generate a shell command"
},
{
"name": "commit",
"description": "Generate a git commit message"
}
],
"experimental": {
"modelContextProtocolServer": {
"transport": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"~/Desktop"
]
}
}
},
"embeddingsProvider": {
"provider": "free-trial"
},
"reranker": {
"name": "free-trial"
}
} |
@adamszewe thanks for opening this! I poked around the TS interface for --
150 | * After initialization has completed, this will be populated with the server's reported capabilities.
151 | */
152 | getServerCapabilities(): ServerCapabilities \| undefined {
153 | return this._serverCapabilities;
154 | }
// Server supports resources and tools, but not prompts
--
214 | expect(client.getServerCapabilities()).toEqual({
215 | resources: {},
216 | tools: {},
217 | }); I think our logic could then look something like this: const capabilities = this.client.getServerCapabilities()
if (capabilities?.resources) {
const resources = this.client.listResources()
// ...
} +1 to the implementation for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ajshedivy I think the right way to do this is probably with the client.getServerCapabilities()
method on the MCP client. Any interest in attempting that?
Edit: totally missed that Patrick caught this above, ignore me!
This would be much cleaner 😁
@Patrick-Erichsen Good find! much better solution 😁 |
Hello, have you solved the problem. I encountered the same issue that I have added the modelContextProtocolServers, but I cannnot see the mcp after I typed @. |
Tried last time a few days ago (maybe they have updated it since) but sadly still didn't work for me |
@SimonB97 @YanxingLiu the config has actually changed in the recent pre-release: |
Thanks for your work, I have tried the setting mentioned in #3462. But it still failed. The detail is shown in that PR. I would like to ask if you know why this is. Thanks a lot for your help. |
Description
proposed fix for #3225
Solution
Since some servers do not provider resources, tools, etc., check if client methods are available with simple wrapper:
There is prob a better way to handle this, but it's a good hot fix 😁
Checklist
Screenshots
Testing
TODO
Adding the
@modelcontextprotocol/server-filesystem
server produces the following warning with the default tools: