Compare commits
5 Commits
e98ad038c5
...
ab81e276d3
Author | SHA1 | Date | |
---|---|---|---|
ab81e276d3 | |||
667e000afe | |||
b4544f08f4 | |||
![]() |
f0b8b88fbc | ||
![]() |
13d05462fe |
35
.vscode/openmcp_connection.json
vendored
35
.vscode/openmcp_connection.json
vendored
@ -1 +1,34 @@
|
||||
{"items":[]}
|
||||
{
|
||||
"items": [
|
||||
[
|
||||
{
|
||||
"connectionType": "STDIO",
|
||||
"command": "mcp",
|
||||
"args": [
|
||||
"run",
|
||||
"main.py"
|
||||
],
|
||||
"url": "",
|
||||
"cwd": "{workspace}/servers",
|
||||
"oauth": "",
|
||||
"clientName": "openmcp.connect.STDIO",
|
||||
"clientVersion": "0.0.1",
|
||||
"env": {
|
||||
"HOME": "/Users/bytedance",
|
||||
"LOGNAME": "bytedance",
|
||||
"PATH": "/opt/homebrew/opt/openjdk@11/bin:/Users/bytedance/Downloads/neo4j-community-4.4.44/bin:/Users/bytedance/.local/bin:/Users/bytedance/.nvm/versions/node/v22.14.0/bin:/Users/bytedance/miniconda3/bin:/Users/bytedance/miniconda3/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/usr/local/go/bin:/opt/puppetlabs/bin:/Users/bytedance/.cargo/bin:/Users/bytedance/Downloads/Visual Studio Code.app/Contents/Resources/app/bin/:/Applications/Trae CN.app/Contents/Resources/app/bin/lib",
|
||||
"SHELL": "/bin/zsh",
|
||||
"TERM": "xterm-256color",
|
||||
"USER": "bytedance"
|
||||
},
|
||||
"serverInfo": {
|
||||
"name": "锦恢的 MCP Server",
|
||||
"version": "1.5.0"
|
||||
},
|
||||
"filePath": "{workspace}/servers/main.py",
|
||||
"name": "锦恢的 MCP Server",
|
||||
"version": "1.5.0"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
30
.vscode/tabs.锦恢的 MCP Server.json
vendored
Normal file
30
.vscode/tabs.锦恢的 MCP Server.json
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"clientId": "737fbd1e-bd1e-5fbd1ee197b-8fbd1ee197b1295-b1295bef",
|
||||
"currentIndex": 0,
|
||||
"tabs": [
|
||||
{
|
||||
"name": "工具",
|
||||
"icon": "icon-tool",
|
||||
"type": "blank",
|
||||
"componentIndex": 2,
|
||||
"storage": {
|
||||
"activeNames": [
|
||||
0
|
||||
],
|
||||
"formData": {
|
||||
"city_code": 101210101
|
||||
},
|
||||
"currentToolName": "get_weather_by_city_code",
|
||||
"lastToolCallResponse": {
|
||||
"content": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "CityWeather(city_name_en='hangzhou', city_name_cn='杭州', city_code='101210101', temp='24.2', wd='', ws='', sd='64%', aqi='54', weather='阴')"
|
||||
}
|
||||
],
|
||||
"isError": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -1,5 +1,11 @@
|
||||
# Change Log
|
||||
|
||||
## [main] 0.1.1
|
||||
- 修复 SSH 连接 Ubuntu 的情况下的部分 bug
|
||||
- 修复 python 项目点击 openmcp 进行连接时,初始化参数错误的问题
|
||||
- 取消 service 底层的 mcp 连接复用技术,防止无法刷新
|
||||
- 修复连接后,可能无法在欢迎界面选择调试选项的 bug
|
||||
|
||||
## [main] 0.1.0
|
||||
- 新特性:支持同时连入多个 mcp server
|
||||
- 新特性:更新协议内容,支持 streamable http 协议,未来将逐步取代 SSE 的连接方式
|
||||
|
@ -4,12 +4,11 @@
|
||||
|
||||
<h3>OpenMCP: 一体化 MCP Server 调试器</h3>
|
||||
|
||||
<a href="https://kirigaya.cn/openmcp" target="_blank" style="display: inline-block; padding: 8px 16px; background-color: rgb(84, 176, 84); color: white; border-radius: .5em; text-decoration: none;"> 📄 OpenMCP 文档网站</a>
|
||||
|
||||
<a href="https://qm.qq.com/cgi-bin/qm/qr?k=C6ZUTZvfqWoI12lWe7L93cWa1hUsuVT0&jump_from=webapi&authKey=McW6B1ogTPjPDrCyGttS890tMZGQ1KB3QLuG4aqVNRaYp4vlTSgf2c6dMcNjMuBD" target="_blank" style="display: inline-block; padding: 8px 16px; background-color: #CB81DA; color: white; border-radius: .5em; text-decoration: none;">👉 加入 OpenMCP正式级技术组</a>
|
||||
|
||||
|
||||
<a href="https://discord.gg/af5cfB9a" target="_blank" style="display: inline-block; padding: 8px 16px; background-color: rgb(84, 176, 84); color: white; border-radius: .5em; text-decoration: none;"> 加入 OpenMCP Discord频道</a>
|
||||
|
||||
<a href="https://github.com/LSTM-Kirigaya/openmcp-document" target="_blank" style="display: inline-block; padding: 8px 16px; background-color: rgb(84, 176, 84); color: white; border-radius: .5em; text-decoration: none;"> 📄OpenMCP 文档仓库</a>
|
||||
<a href="https://discord.gg/SKTZRf6NzU" target="_blank" style="display: inline-block; padding: 8px 16px; background-color: rgb(84, 176, 84); color: white; border-radius: .5em; text-decoration: none;"> 加入 OpenMCP Discord频道</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
"name": "openmcp",
|
||||
"displayName": "OpenMCP",
|
||||
"description": "An all in one MCP Client/TestTool",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"publisher": "kirigaya",
|
||||
"author": {
|
||||
"name": "kirigaya",
|
||||
|
@ -6,7 +6,7 @@
|
||||
</span>
|
||||
|
||||
<p>
|
||||
OpenMCP Client 0.1.0 由 OpenMCP@<a href="https://www.zhihu.com/people/can-meng-zhong-de-che-xian">锦恢</a> 开发
|
||||
OpenMCP Client 0.1.1 由 OpenMCP@<a href="https://www.zhihu.com/people/can-meng-zhong-de-che-xian">锦恢</a> 开发
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
@ -563,6 +563,10 @@ class McpClientAdapter {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public get connected() {
|
||||
return this.clients.length > 0 && this.clients[0].connectionResult.success;
|
||||
}
|
||||
|
||||
public async loadPanels() {
|
||||
const masterNode = this.clients[0];
|
||||
await loadPanels(masterNode);
|
||||
|
@ -7,7 +7,7 @@
|
||||
<!-- TODO: 支持更多的 server -->
|
||||
<span
|
||||
class="debug-option"
|
||||
:class="{ 'disable': !client.connectionResult.success }"
|
||||
:class="{ 'disable': !mcpClientAdapter.connected }"
|
||||
v-for="(option, index) of debugOptions"
|
||||
:key="index"
|
||||
@click="chooseDebugMode(index)"
|
||||
@ -32,7 +32,6 @@ import { mcpClientAdapter } from '../connect/core';
|
||||
defineComponent({ name: 'welcome' });
|
||||
|
||||
const { t } = useI18n();
|
||||
const client = mcpClientAdapter.masterNode;
|
||||
|
||||
const debugOptions = [
|
||||
{
|
||||
@ -60,7 +59,7 @@ const debugOptions = [
|
||||
function chooseDebugMode(index: number) {
|
||||
|
||||
// TODO: 支持更多的 server
|
||||
if (client.connectionResult.success) {
|
||||
if (mcpClientAdapter.connected) {
|
||||
const activeTab = tabs.activeTab;
|
||||
activeTab.component = markRaw(debugModes[index]);
|
||||
|
||||
|
@ -30,6 +30,7 @@ export async function routeMessage(command: string, data: any, webview: PostMess
|
||||
webview.postMessage({ command, data: res });
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
webview.postMessage({
|
||||
command, data: {
|
||||
code: 500,
|
||||
|
@ -133,8 +133,12 @@ export class McpClient {
|
||||
// 调用工具
|
||||
public async callTool(options: { name: string; arguments: Record<string, any>, callToolOption?: any }) {
|
||||
const { callToolOption, ...methodArgs } = options;
|
||||
console.log('methodArgs', methodArgs);
|
||||
console.log('callToolOption', callToolOption);
|
||||
return await this.client.callTool(methodArgs, undefined, callToolOption);
|
||||
const res = await this.client.callTool(methodArgs, undefined, callToolOption);
|
||||
console.log('callTool res', res);
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -249,12 +249,15 @@ export async function connectService(
|
||||
const uuid = await deterministicUUID(JSON.stringify(option));
|
||||
|
||||
const reuseConntion = clientMap.has(uuid);
|
||||
if (!clientMap.has(uuid)) {
|
||||
const client = await connect(option);
|
||||
clientMap.set(uuid, client);
|
||||
}
|
||||
|
||||
// if (!clientMap.has(uuid)) {
|
||||
// const client = await connect(option);
|
||||
// clientMap.set(uuid, client);
|
||||
// }
|
||||
// const client = clientMap.get(uuid)!;
|
||||
|
||||
const client = clientMap.get(uuid)!;
|
||||
const client = await connect(option);
|
||||
clientMap.set(uuid, client);
|
||||
|
||||
const versionInfo = client.getServerVersion();
|
||||
|
||||
|
@ -19,12 +19,12 @@ export class HelpProvider implements vscode.TreeDataProvider<SidebarItem> {
|
||||
new SidebarItem('入门', vscode.TreeItemCollapsibleState.None, {
|
||||
command: 'vscode.open',
|
||||
title: 'Open Guide',
|
||||
arguments: [vscode.Uri.parse('https://zhuanlan.zhihu.com/p/1896301240826184013')]
|
||||
arguments: [vscode.Uri.parse('https://kirigaya.cn/openmcp/plugin-tutorial/usage/connect-mcp.html·')]
|
||||
}, 'book'),
|
||||
new SidebarItem('阅读文档', vscode.TreeItemCollapsibleState.None, {
|
||||
command: 'vscode.open',
|
||||
title: 'Open Documentation',
|
||||
arguments: [vscode.Uri.parse('https://document.kirigaya.cn/blogs/openmcp/main.html')]
|
||||
arguments: [vscode.Uri.parse('https://kirigaya.cn/openmcp')]
|
||||
}, 'file-text'),
|
||||
new SidebarItem('报告问题', vscode.TreeItemCollapsibleState.None, {
|
||||
command: 'vscode.open',
|
||||
|
@ -22,8 +22,8 @@ export class McpInstalledConnectProvider implements vscode.TreeDataProvider<Conn
|
||||
const connection = getConnectionConfig();
|
||||
const sidebarItems = connection.items.map((item, index) => {
|
||||
// 连接的名字
|
||||
item = Array.isArray(item)? item[0] : item;
|
||||
const itemName = `${item.name} (${item.type || item.connectionType})`
|
||||
const nItem = Array.isArray(item)? item[0] : item;
|
||||
const itemName = `${nItem.name} (${nItem.type || nItem.connectionType})`
|
||||
return new ConnectionViewItem(itemName, vscode.TreeItemCollapsibleState.None, item, 'server');
|
||||
})
|
||||
|
||||
|
@ -22,8 +22,8 @@ export class McpWorkspaceConnectProvider implements vscode.TreeDataProvider<Conn
|
||||
const connection = getWorkspaceConnectionConfig();
|
||||
const sidebarItems = connection.items.map((item, index) => {
|
||||
// 连接的名字
|
||||
item = Array.isArray(item) ? item[0] : item;
|
||||
const itemName = `${item.name} (${item.type || item.connectionType})`
|
||||
const nItem = Array.isArray(item) ? item[0] : item;
|
||||
const itemName = `${nItem.name} (${nItem.type || nItem.connectionType})`
|
||||
return new ConnectionViewItem(itemName, vscode.TreeItemCollapsibleState.None, item, 'server');
|
||||
})
|
||||
|
||||
|
@ -5,6 +5,9 @@ export async function deleteUserConnection(item: McpOptions[] | McpOptions) {
|
||||
// 弹出确认对话框
|
||||
const masterNode = Array.isArray(item) ? item[0] : item;
|
||||
const name = masterNode.name;
|
||||
|
||||
console.log('enter delete');
|
||||
|
||||
const confirm = await vscode.window.showWarningMessage(
|
||||
`确定要删除连接 "${name}" 吗?`,
|
||||
{ modal: true },
|
||||
@ -18,6 +21,10 @@ export async function deleteUserConnection(item: McpOptions[] | McpOptions) {
|
||||
const workspaceConnectionConfig = getWorkspaceConnectionConfig();
|
||||
|
||||
// 从配置中移除该连接项
|
||||
console.log(item);
|
||||
console.log(workspaceConnectionConfig.items);
|
||||
// TODO: 改成基于 path 进行搜索
|
||||
|
||||
const index = workspaceConnectionConfig.items.indexOf(item);
|
||||
if (index !== -1) {
|
||||
workspaceConnectionConfig.items.splice(index, 1);
|
||||
|
@ -1,7 +1,8 @@
|
||||
import * as vscode from 'vscode';
|
||||
import { RegisterCommand } from "../common";
|
||||
import { getDefaultLanunchSignature, getLaunchCWD, revealOpenMcpWebviewPanel } from './webview.service';
|
||||
import { getDefaultLanunchSignature, getWorkspacePath, revealOpenMcpWebviewPanel } from './webview.service';
|
||||
import { getWorkspaceConnectionConfigItemByPath } from '../global';
|
||||
import path from 'path';
|
||||
|
||||
export class WebviewController {
|
||||
@RegisterCommand('openmcp.showOpenMCP')
|
||||
@ -10,8 +11,7 @@ export class WebviewController {
|
||||
|
||||
if (!connectionItem) {
|
||||
// 项目不存在连接信息
|
||||
const cwd = getLaunchCWD(context, uri);
|
||||
|
||||
const cwd = path.dirname(uri.fsPath);
|
||||
const signature = getDefaultLanunchSignature(uri.fsPath, cwd);
|
||||
|
||||
if (!signature) {
|
||||
|
@ -24,7 +24,7 @@ export function getWebviewContent(context: vscode.ExtensionContext, panel: vscod
|
||||
return html;
|
||||
}
|
||||
|
||||
export function getLaunchCWD(context: vscode.ExtensionContext, uri: vscode.Uri) {
|
||||
export function getWorkspacePath(context: vscode.ExtensionContext, uri: vscode.Uri) {
|
||||
// TODO: 启动上下文?
|
||||
// 获取当前打开的项目的路径
|
||||
const workspaceFolder = vscode.workspace.getWorkspaceFolder(uri);
|
||||
|
Loading…
x
Reference in New Issue
Block a user