Skip to content

feat: add mcp client #1034

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

Merged
merged 4 commits into from
Apr 23, 2025
Merged

feat: add mcp client #1034

merged 4 commits into from
Apr 23, 2025

Conversation

bywang56
Copy link
Contributor

Problem

Support MCP

Solution

Basic MCP client implementation

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@bywang56 bywang56 requested a review from a team as a code owner April 21, 2025 23:10
@bywang56 bywang56 force-pushed the feature/mcp branch 5 times, most recently from d457ca4 to 637ae37 Compare April 22, 2025 21:11
const content = typeof result === 'object' ? JSON.stringify(result) : String(result)
return {
output: {
kind: OutputKind.Text,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see we are hardcoding this, is that expected?

Copy link
Contributor Author

@bywang56 bywang56 Apr 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, for not we hard code it as text, this might change as part of the future ux work

args?: string[]
env?: Record<string, string>
disabled?: boolean
autoApprove?: string[]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this field do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not currently used, the entire validation/approval logic for MCP tools has not been implemented yet, I think in the future we might support some global setting to auto approve all MCP tools

continue
}
const cfg: MCPServerConfig = {
command: (entry as any).command,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe put entry into a variable and typecast it to avoid having to keep using as any

@@ -6,11 +6,13 @@ import { ExecuteBash, ExecuteBashParams } from './executeBash'
import { LspGetDocuments, LspGetDocumentsParams } from './lspGetDocuments'
import { LspReadDocumentContents, LspReadDocumentContentsParams } from './lspReadDocumentContents'
import { LspApplyWorkspaceEdit, LspApplyWorkspaceEditParams } from './lspApplyWorkspaceEdit'
import path = require('path')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is this being used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will remove.

@bywang56 bywang56 enabled auto-merge (squash) April 22, 2025 23:59
@bywang56 bywang56 merged commit 626b126 into aws:main Apr 23, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants