-
Notifications
You must be signed in to change notification settings - Fork 335
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
Adding cody mcp #6589
base: main
Are you sure you want to change the base?
Adding cody mcp #6589
Conversation
05f7fc9
to
e0bc155
Compare
730d2b8
to
21dfc17
Compare
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.
I just noticed you are on an old branch so probably unaware of the changes we have on main where we automatically build the tool from openCtx providers via setupOpenCtxProviderListener
. In that method we can get the mentions from the MCP and convert them using openCtxProviderMetadata so that we can create the tools for all openCtx providers using the same createOpenCtxTools method.
Let me know if this is confusing or if you have any concerns about this approach!
public parse(): string[] { | ||
try { | ||
JSON.parse(this.unprocessedText) | ||
} catch { | ||
return [] | ||
} | ||
const unparsedText = this.unprocessedText | ||
this.reset() | ||
return [unparsedText] | ||
} |
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.
public parse(): string[] { | |
try { | |
JSON.parse(this.unprocessedText) | |
} catch { | |
return [] | |
} | |
const unparsedText = this.unprocessedText | |
this.reset() | |
return [unparsedText] | |
} |
As discussed, this is for parsing the sub XML tag where the queries are returned by the LLM through stream. we can move this into execute instead
return [unparsedText] | ||
} | ||
|
||
public async execute(span: Span, queries: string[]): Promise<ContextItem[]> { |
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.
it looks like the queries
param is not being used here. How does it get the items in this case? 👀
"openctx.mcp.enable": { | ||
"type": "boolean", | ||
"markdownDescription": "Enable OpenCtx providers for Cody.", | ||
"default": true | ||
}, | ||
"openctx.mcp.uri": { | ||
"type": "string", | ||
"markdownDescription": "URI for the MCP provider tools in OpenCtx.", | ||
"default": "" | ||
}, |
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.
Q: What's the reason behind having a separated field for these instead of using the existing openctx.providers
that handles provider changes?
@@ -235,6 +237,56 @@ class SearchTool extends CodyTool { | |||
} | |||
} | |||
|
|||
export class ModelContextProviderTool extends CodyTool { |
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.
We can use OpenCtxTool to handle this?
21dfc17
to
dbd67b1
Compare
…ovider (#6650) - Asynchronously create OpenCtxTools for model context protocol providers - Implement `createModelContextConfig` to handle the specific configuration for model context protocol providers - ## Test plan <!-- Required. See https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles. --> Needs to test it with the changes in #6589 --------- Co-authored-by: arafatkatze <[email protected]>
0494a03
to
b408de1
Compare
b408de1
to
0113b3e
Compare
|
Related OpenContext PR
Purposely waiting to do the final steps of the PR AFTER the base merge conflicts from Bee's PR is resolved and a demo is shared and discussed properly.
Test plan