Skip to content

Commit 8fe6d8d

Browse files
committed
修复mcp客户端链接地址问题
1 parent 9b09914 commit 8fe6d8d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

web/src/views/mcp/MCPClient.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ const messages = ref('')
6565
const connectionStatus = ref('Disconnected')
6666
//https://github.com/modelcontextprotocol/typescript-sdk
6767
// StdioClientTransport
68-
const transport = new SSEClientTransport(new URL('http://localhost:8000/sse'))
68+
// 如果是本地开发,需要使用 localhost 来访问宿主机的mcp服务
69+
const transport = new SSEClientTransport(
70+
new URL('http://host.docker.internal:8000/sse')
71+
)
6972
7073
const client = new Client(
7174
{

0 commit comments

Comments
 (0)