-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6499f4
commit 05f7fc9
Showing
7 changed files
with
182 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import proxy from '@openctx/provider-modelcontextprotocoltools' | ||
|
||
import { MODEL_CONTEXT_PROVIDER_URI } from '@sourcegraph/cody-shared' | ||
import type { OpenCtxProvider } from './types' | ||
|
||
export async function createModelContextProvider(): Promise<OpenCtxProvider> { | ||
return { | ||
providerUri: MODEL_CONTEXT_PROVIDER_URI, | ||
|
||
async meta() { | ||
const client = await proxy.meta!( | ||
{}, | ||
{ | ||
'mcp.provider.uri': | ||
'file:///Users/arafatkhan/Desktop/servers/src/everything/dist/index.js', | ||
'mcp.provider.args': [], | ||
} | ||
) | ||
console.log(' the client for me is ', client) | ||
|
||
return { | ||
name: 'Code Search', | ||
} | ||
}, | ||
async mentions({ query }) { | ||
// returns a list of available tools in MCP | ||
const items = await proxy.mentions!({ query: 'noti' }, {}) | ||
console.log(' the items for me are ', items) | ||
return items | ||
}, | ||
|
||
async items({ mention }) { | ||
// returns the result of a speciic tool of MCP | ||
const items = await proxy.items!({ mention }, {}) | ||
console.log(' the items for me are ', items) | ||
return items | ||
}, | ||
} | ||
} |