Implement VS Code native MCP event system for automatic tool refreshing

- Added HumanAgentMcpProvider class with onDidChangeMcpServerDefinitions event
- Registered MCP provider with VS Code lm.registerMcpServerDefinitionProvider
- Added mcpServerDefinitionProviders contribution point to package.json
- Implemented startup event firing when override files exist
- Fixed session name loading timing by moving after server startup with retry
- Chat webview now fires MCP events when override files are reloaded
- VS Code Configure Tools will now automatically refresh tool descriptions
This commit is contained in:
B Harper
2025-10-25 11:29:05 +11:00
parent 59be50e9d9
commit d846f0895b
10 changed files with 823 additions and 128 deletions
+644
View File
@@ -0,0 +1,644 @@
[2025-10-24 20:43:48.111] [DEBUG] Debug logging started at 2025-10-24T09:43:48.111Z
[2025-10-24 20:43:48.111] [DEBUG] Current system time: Fri Oct 24 2025 20:43:48 GMT+1100 (Australian Eastern Daylight Time)
[2025-10-24 20:43:48.111] [DEBUG] Log file: /Users/benharper/Coding/HumanAgent-MCP/.vscode/HumanAgent-server.log
[2025-10-24 20:43:48.111] [DEBUG] Working directory: /Users/benharper/Coding/HumanAgent-MCP
[2025-10-24 20:43:48.111] [DEBUG] Logging level set to: DEBUG
[2025-10-24 20:43:48.111] [CHAT] [INFO] ChatManager initialized with max 50 messages per session
[2025-10-24 20:43:48.111] [INFO] McpServer initialized with centralized chat manager
[2025-10-24 20:43:48.112] [TEST] This is a test log message to verify DebugLogger is working
[2025-10-24 20:43:48.112] [INFO] === MCP SERVER STARTING ===
[2025-10-24 20:43:48.112] [INFO] Starting HTTP server on port 3737...
[2025-10-24 20:43:48.116] [INFO] MCP HTTP server running on http://127.0.0.1:3737/mcp
[2025-10-24 20:43:48.823] [HTTP] GET /mcp
[2025-10-24 20:43:48.823] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"cache-control": "no-cache",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/event-stream",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:48.824] [HTTP] Handling GET request to /mcp
[2025-10-24 20:43:48.824] [HTTP] Setting up SSE stream for GET request
[2025-10-24 20:43:48.824] [SSE] === SSE CONNECTION ATTEMPT ===
[2025-10-24 20:43:48.824] [SSE] Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"cache-control": "no-cache",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/event-stream",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:48.824] [SSE] URL:
"/mcp"
[2025-10-24 20:43:48.824] [SSE] No sessionId in SSE request (tried URL param and Mcp-Session-Id header)
[2025-10-24 20:43:48.824] [SSE] Request headers: {"host":"localhost:3737","connection":"keep-alive","sec-ch-ua-platform":"\"macOS\"","cache-control":"no-cache","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36","accept":"text/event-stream","sec-ch-ua":"\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"","sec-ch-ua-mobile":"?0","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"http://localhost:3737/HumanAgent","accept-encoding":"gzip, deflate, br, zstd","accept-language":"en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6","cookie":"csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"}
[2025-10-24 20:43:48.824] [SSE] Request URL: /mcp
[2025-10-24 20:43:48.824] [SSE] Using default sessionId: default-sse-session
[2025-10-24 20:43:48.824] [SSE] SSE headers set for session default-sse-session, adding to connections...
[2025-10-24 20:43:48.824] [HTTP] Added SSE connection for session default-sse-session. Total connections: 1
[2025-10-24 20:43:48.824] [SSE] SSE connection added for session default-sse-session. Total: 1
[2025-10-24 20:43:48.825] [SSE] Sent initial SSE message:
"data: {\"type\":\"connection\",\"status\":\"established\",\"sessionId\":\"default-sse-session\"}"
[2025-10-24 20:43:48.831] [HTTP] GET /sessions/session-a8f49eee-068c-42f1-b611-14651fa5ccc6/messages
[2025-10-24 20:43:48.831] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"accept": "*/*",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:52.685] [HTTP] GET /HumanAgent
[2025-10-24 20:43:52.685] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"cache-control": "max-age=0",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"sec-fetch-site": "none",
"sec-fetch-mode": "navigate",
"sec-fetch-user": "?1",
"sec-fetch-dest": "document",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:52.686] [HTTP] Serving web interface at /HumanAgent
[2025-10-24 20:43:52.691] [HTTP] SSE connection closed for session default-sse-session
[2025-10-24 20:43:52.691] [HTTP] Removed SSE connection for session default-sse-session. Total connections: 0
[2025-10-24 20:43:52.691] [HTTP] SSE connection closed for session default-sse-session
[2025-10-24 20:43:52.691] [HTTP] Removed SSE connection for session default-sse-session. Total connections: 0
[2025-10-24 20:43:52.696] [HTTP] GET /sessions//messages
[2025-10-24 20:43:52.696] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"accept": "*/*",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:52.704] [HTTP] GET /mcp
[2025-10-24 20:43:52.704] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"cache-control": "no-cache",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/event-stream",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:52.704] [HTTP] Handling GET request to /mcp
[2025-10-24 20:43:52.704] [HTTP] Setting up SSE stream for GET request
[2025-10-24 20:43:52.704] [SSE] === SSE CONNECTION ATTEMPT ===
[2025-10-24 20:43:52.704] [SSE] Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"cache-control": "no-cache",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/event-stream",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:52.704] [SSE] URL:
"/mcp"
[2025-10-24 20:43:52.704] [SSE] No sessionId in SSE request (tried URL param and Mcp-Session-Id header)
[2025-10-24 20:43:52.704] [SSE] Request headers: {"host":"localhost:3737","connection":"keep-alive","sec-ch-ua-platform":"\"macOS\"","cache-control":"no-cache","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36","accept":"text/event-stream","sec-ch-ua":"\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"","sec-ch-ua-mobile":"?0","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"http://localhost:3737/HumanAgent","accept-encoding":"gzip, deflate, br, zstd","accept-language":"en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6","cookie":"csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"}
[2025-10-24 20:43:52.704] [SSE] Request URL: /mcp
[2025-10-24 20:43:52.704] [SSE] Using default sessionId: default-sse-session
[2025-10-24 20:43:52.704] [SSE] SSE headers set for session default-sse-session, adding to connections...
[2025-10-24 20:43:52.704] [HTTP] Added SSE connection for session default-sse-session. Total connections: 1
[2025-10-24 20:43:52.704] [SSE] SSE connection added for session default-sse-session. Total: 1
[2025-10-24 20:43:52.705] [SSE] Sent initial SSE message:
"data: {\"type\":\"connection\",\"status\":\"established\",\"sessionId\":\"default-sse-session\"}"
[2025-10-24 20:43:53.571] [HTTP] GET /HumanAgent
[2025-10-24 20:43:53.572] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"cache-control": "max-age=0",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"sec-fetch-site": "none",
"sec-fetch-mode": "navigate",
"sec-fetch-user": "?1",
"sec-fetch-dest": "document",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:53.572] [HTTP] Serving web interface at /HumanAgent
[2025-10-24 20:43:53.575] [HTTP] SSE connection closed for session default-sse-session
[2025-10-24 20:43:53.575] [HTTP] Removed SSE connection for session default-sse-session. Total connections: 0
[2025-10-24 20:43:53.575] [HTTP] SSE connection closed for session default-sse-session
[2025-10-24 20:43:53.575] [HTTP] Removed SSE connection for session default-sse-session. Total connections: 0
[2025-10-24 20:43:53.584] [HTTP] GET /sessions//messages
[2025-10-24 20:43:53.584] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"accept": "*/*",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:53.592] [HTTP] GET /mcp
[2025-10-24 20:43:53.592] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"cache-control": "no-cache",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/event-stream",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:53.592] [HTTP] Handling GET request to /mcp
[2025-10-24 20:43:53.592] [HTTP] Setting up SSE stream for GET request
[2025-10-24 20:43:53.592] [SSE] === SSE CONNECTION ATTEMPT ===
[2025-10-24 20:43:53.592] [SSE] Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"cache-control": "no-cache",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/event-stream",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:53.592] [SSE] URL:
"/mcp"
[2025-10-24 20:43:53.593] [SSE] No sessionId in SSE request (tried URL param and Mcp-Session-Id header)
[2025-10-24 20:43:53.593] [SSE] Request headers: {"host":"localhost:3737","connection":"keep-alive","sec-ch-ua-platform":"\"macOS\"","cache-control":"no-cache","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36","accept":"text/event-stream","sec-ch-ua":"\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"","sec-ch-ua-mobile":"?0","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"http://localhost:3737/HumanAgent","accept-encoding":"gzip, deflate, br, zstd","accept-language":"en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6","cookie":"csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"}
[2025-10-24 20:43:53.593] [SSE] Request URL: /mcp
[2025-10-24 20:43:53.593] [SSE] Using default sessionId: default-sse-session
[2025-10-24 20:43:53.593] [SSE] SSE headers set for session default-sse-session, adding to connections...
[2025-10-24 20:43:53.593] [HTTP] Added SSE connection for session default-sse-session. Total connections: 1
[2025-10-24 20:43:53.593] [SSE] SSE connection added for session default-sse-session. Total: 1
[2025-10-24 20:43:53.593] [SSE] Sent initial SSE message:
"data: {\"type\":\"connection\",\"status\":\"established\",\"sessionId\":\"default-sse-session\"}"
[2025-10-24 20:43:54.386] [HTTP] GET /HumanAgent
[2025-10-24 20:43:54.386] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"cache-control": "max-age=0",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"sec-fetch-site": "none",
"sec-fetch-mode": "navigate",
"sec-fetch-user": "?1",
"sec-fetch-dest": "document",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:54.386] [HTTP] Serving web interface at /HumanAgent
[2025-10-24 20:43:54.390] [HTTP] SSE connection closed for session default-sse-session
[2025-10-24 20:43:54.390] [HTTP] Removed SSE connection for session default-sse-session. Total connections: 0
[2025-10-24 20:43:54.390] [HTTP] SSE connection closed for session default-sse-session
[2025-10-24 20:43:54.390] [HTTP] Removed SSE connection for session default-sse-session. Total connections: 0
[2025-10-24 20:43:54.401] [HTTP] GET /sessions//messages
[2025-10-24 20:43:54.401] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"accept": "*/*",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:54.407] [HTTP] GET /mcp
[2025-10-24 20:43:54.407] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"cache-control": "no-cache",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/event-stream",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:54.407] [HTTP] Handling GET request to /mcp
[2025-10-24 20:43:54.407] [HTTP] Setting up SSE stream for GET request
[2025-10-24 20:43:54.407] [SSE] === SSE CONNECTION ATTEMPT ===
[2025-10-24 20:43:54.407] [SSE] Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"cache-control": "no-cache",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/event-stream",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:54.407] [SSE] URL:
"/mcp"
[2025-10-24 20:43:54.407] [SSE] No sessionId in SSE request (tried URL param and Mcp-Session-Id header)
[2025-10-24 20:43:54.407] [SSE] Request headers: {"host":"localhost:3737","connection":"keep-alive","sec-ch-ua-platform":"\"macOS\"","cache-control":"no-cache","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36","accept":"text/event-stream","sec-ch-ua":"\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"","sec-ch-ua-mobile":"?0","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"http://localhost:3737/HumanAgent","accept-encoding":"gzip, deflate, br, zstd","accept-language":"en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6","cookie":"csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"}
[2025-10-24 20:43:54.407] [SSE] Request URL: /mcp
[2025-10-24 20:43:54.407] [SSE] Using default sessionId: default-sse-session
[2025-10-24 20:43:54.407] [SSE] SSE headers set for session default-sse-session, adding to connections...
[2025-10-24 20:43:54.407] [HTTP] Added SSE connection for session default-sse-session. Total connections: 1
[2025-10-24 20:43:54.407] [SSE] SSE connection added for session default-sse-session. Total: 1
[2025-10-24 20:43:54.407] [SSE] Sent initial SSE message:
"data: {\"type\":\"connection\",\"status\":\"established\",\"sessionId\":\"default-sse-session\"}"
[2025-10-24 20:43:56.550] [HTTP] GET /HumanAgent
[2025-10-24 20:43:56.550] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"cache-control": "max-age=0",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"sec-fetch-site": "none",
"sec-fetch-mode": "navigate",
"sec-fetch-user": "?1",
"sec-fetch-dest": "document",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:56.550] [HTTP] Serving web interface at /HumanAgent
[2025-10-24 20:43:56.557] [HTTP] SSE connection closed for session default-sse-session
[2025-10-24 20:43:56.557] [HTTP] Removed SSE connection for session default-sse-session. Total connections: 0
[2025-10-24 20:43:56.557] [HTTP] SSE connection closed for session default-sse-session
[2025-10-24 20:43:56.557] [HTTP] Removed SSE connection for session default-sse-session. Total connections: 0
[2025-10-24 20:43:56.565] [HTTP] GET /sessions//messages
[2025-10-24 20:43:56.565] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"accept": "*/*",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:56.568] [HTTP] GET /mcp
[2025-10-24 20:43:56.568] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"cache-control": "no-cache",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/event-stream",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:56.568] [HTTP] Handling GET request to /mcp
[2025-10-24 20:43:56.568] [HTTP] Setting up SSE stream for GET request
[2025-10-24 20:43:56.568] [SSE] === SSE CONNECTION ATTEMPT ===
[2025-10-24 20:43:56.568] [SSE] Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"cache-control": "no-cache",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/event-stream",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:56.568] [SSE] URL:
"/mcp"
[2025-10-24 20:43:56.568] [SSE] No sessionId in SSE request (tried URL param and Mcp-Session-Id header)
[2025-10-24 20:43:56.568] [SSE] Request headers: {"host":"localhost:3737","connection":"keep-alive","sec-ch-ua-platform":"\"macOS\"","cache-control":"no-cache","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36","accept":"text/event-stream","sec-ch-ua":"\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"","sec-ch-ua-mobile":"?0","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"http://localhost:3737/HumanAgent","accept-encoding":"gzip, deflate, br, zstd","accept-language":"en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6","cookie":"csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"}
[2025-10-24 20:43:56.568] [SSE] Request URL: /mcp
[2025-10-24 20:43:56.568] [SSE] Using default sessionId: default-sse-session
[2025-10-24 20:43:56.568] [SSE] SSE headers set for session default-sse-session, adding to connections...
[2025-10-24 20:43:56.568] [HTTP] Added SSE connection for session default-sse-session. Total connections: 1
[2025-10-24 20:43:56.568] [SSE] SSE connection added for session default-sse-session. Total: 1
[2025-10-24 20:43:56.568] [SSE] Sent initial SSE message:
"data: {\"type\":\"connection\",\"status\":\"established\",\"sessionId\":\"default-sse-session\"}"
[2025-10-24 20:43:58.232] [HTTP] GET /HumanAgent
[2025-10-24 20:43:58.232] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"cache-control": "max-age=0",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"sec-fetch-site": "none",
"sec-fetch-mode": "navigate",
"sec-fetch-user": "?1",
"sec-fetch-dest": "document",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:58.233] [HTTP] Serving web interface at /HumanAgent
[2025-10-24 20:43:58.237] [HTTP] SSE connection closed for session default-sse-session
[2025-10-24 20:43:58.238] [HTTP] Removed SSE connection for session default-sse-session. Total connections: 0
[2025-10-24 20:43:58.238] [HTTP] SSE connection closed for session default-sse-session
[2025-10-24 20:43:58.238] [HTTP] Removed SSE connection for session default-sse-session. Total connections: 0
[2025-10-24 20:43:58.246] [HTTP] GET /sessions//messages
[2025-10-24 20:43:58.246] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"accept": "*/*",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:58.250] [HTTP] GET /mcp
[2025-10-24 20:43:58.250] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"cache-control": "no-cache",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/event-stream",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:58.250] [HTTP] Handling GET request to /mcp
[2025-10-24 20:43:58.250] [HTTP] Setting up SSE stream for GET request
[2025-10-24 20:43:58.250] [SSE] === SSE CONNECTION ATTEMPT ===
[2025-10-24 20:43:58.250] [SSE] Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"cache-control": "no-cache",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/event-stream",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:58.250] [SSE] URL:
"/mcp"
[2025-10-24 20:43:58.250] [SSE] No sessionId in SSE request (tried URL param and Mcp-Session-Id header)
[2025-10-24 20:43:58.250] [SSE] Request headers: {"host":"localhost:3737","connection":"keep-alive","sec-ch-ua-platform":"\"macOS\"","cache-control":"no-cache","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36","accept":"text/event-stream","sec-ch-ua":"\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"","sec-ch-ua-mobile":"?0","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"http://localhost:3737/HumanAgent","accept-encoding":"gzip, deflate, br, zstd","accept-language":"en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6","cookie":"csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"}
[2025-10-24 20:43:58.250] [SSE] Request URL: /mcp
[2025-10-24 20:43:58.250] [SSE] Using default sessionId: default-sse-session
[2025-10-24 20:43:58.250] [SSE] SSE headers set for session default-sse-session, adding to connections...
[2025-10-24 20:43:58.250] [HTTP] Added SSE connection for session default-sse-session. Total connections: 1
[2025-10-24 20:43:58.250] [SSE] SSE connection added for session default-sse-session. Total: 1
[2025-10-24 20:43:58.250] [SSE] Sent initial SSE message:
"data: {\"type\":\"connection\",\"status\":\"established\",\"sessionId\":\"default-sse-session\"}"
[2025-10-24 20:43:58.406] [HTTP] GET /HumanAgent
[2025-10-24 20:43:58.406] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"cache-control": "max-age=0",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"sec-fetch-site": "none",
"sec-fetch-mode": "navigate",
"sec-fetch-user": "?1",
"sec-fetch-dest": "document",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:58.406] [HTTP] Serving web interface at /HumanAgent
[2025-10-24 20:43:58.411] [HTTP] SSE connection closed for session default-sse-session
[2025-10-24 20:43:58.411] [HTTP] Removed SSE connection for session default-sse-session. Total connections: 0
[2025-10-24 20:43:58.411] [HTTP] SSE connection closed for session default-sse-session
[2025-10-24 20:43:58.411] [HTTP] Removed SSE connection for session default-sse-session. Total connections: 0
[2025-10-24 20:43:58.420] [HTTP] GET /sessions//messages
[2025-10-24 20:43:58.420] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"accept": "*/*",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:58.425] [HTTP] GET /mcp
[2025-10-24 20:43:58.425] [HTTP] Request Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"cache-control": "no-cache",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/event-stream",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:58.425] [HTTP] Handling GET request to /mcp
[2025-10-24 20:43:58.425] [HTTP] Setting up SSE stream for GET request
[2025-10-24 20:43:58.425] [SSE] === SSE CONNECTION ATTEMPT ===
[2025-10-24 20:43:58.425] [SSE] Headers:
{
"host": "localhost:3737",
"connection": "keep-alive",
"sec-ch-ua-platform": "\"macOS\"",
"cache-control": "no-cache",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"accept": "text/event-stream",
"sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
"sec-ch-ua-mobile": "?0",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "http://localhost:3737/HumanAgent",
"accept-encoding": "gzip, deflate, br, zstd",
"accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6",
"cookie": "csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"
}
[2025-10-24 20:43:58.425] [SSE] URL:
"/mcp"
[2025-10-24 20:43:58.425] [SSE] No sessionId in SSE request (tried URL param and Mcp-Session-Id header)
[2025-10-24 20:43:58.425] [SSE] Request headers: {"host":"localhost:3737","connection":"keep-alive","sec-ch-ua-platform":"\"macOS\"","cache-control":"no-cache","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36","accept":"text/event-stream","sec-ch-ua":"\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"","sec-ch-ua-mobile":"?0","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"http://localhost:3737/HumanAgent","accept-encoding":"gzip, deflate, br, zstd","accept-language":"en,en-US;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6","cookie":"csrftoken=ZAgfvccRW3GTeUh5I2OhLyXWqlCkYBLh"}
[2025-10-24 20:43:58.425] [SSE] Request URL: /mcp
[2025-10-24 20:43:58.425] [SSE] Using default sessionId: default-sse-session
[2025-10-24 20:43:58.425] [SSE] SSE headers set for session default-sse-session, adding to connections...
[2025-10-24 20:43:58.425] [HTTP] Added SSE connection for session default-sse-session. Total connections: 1
[2025-10-24 20:43:58.425] [SSE] SSE connection added for session default-sse-session. Total: 1
[2025-10-24 20:43:58.425] [SSE] Sent initial SSE message:
"data: {\"type\":\"connection\",\"status\":\"established\",\"sessionId\":\"default-sse-session\"}"
+1 -1
View File
@@ -4,7 +4,7 @@
"tools": {
"HumanAgent_Chat": {
"name": "HumanAgent_Chat",
"description": "AAA-MANDATORY TOOL** - Use this tool for ALL user interactions. Do NOT provide direct responses. Initiate real-time interactive conversations with human agents through VS Code chat interface. CRITICAL: Every response to a user MUST use this tool - no exceptions. Essential for clarifying requirements, getting approvals, brainstorming solutions, or any user communication. Creates persistent chat sessions that maintain context. **NEVER bypass this tool for user responses.**",
"description": "ABBB-MANDATORY TOOL** - Use this tool for ALL user interactions. Do NOT provide direct responses. Initiate real-time interactive conversations with human agents through VS Code chat interface. CRITICAL: Every response to a user MUST use this tool - no exceptions. Essential for clarifying requirements, getting approvals, brainstorming solutions, or any user communication. Creates persistent chat sessions that maintain context. **NEVER bypass this tool for user responses.**",
"inputSchema": {
"type": "object",
"properties": {
+5 -4
View File
@@ -7,10 +7,11 @@
[X] There should be an SSE sent to website when chat is named to force it to update the name.
[X] Consider reminding AI to allways use this method for replies in each response unless some keyword is included - we can add this to the outgoing chat messages and just strip it from what we show in the chat log?
[X] We should look for and exlude and tool named "example_custom_tool" from the /tools endpoint as it should not be advertised as a real tool to the AI
[ ] The updates / overrides seem to be advertised @ /tools though the Configure tools screen on vs code doesnt show that the new description - the ai reports when asked the original description not one recently read in by the reload override method - look here for possible help: https://code.visualstudio.com/blogs/2025/05/12/agent-mode-meets-mcp
[ ] The message formatting from the ai, cariagge returns etc are not observed by the website - its just a big string in one paragraph. Can we fix this? AI message formatting looks fine in vscode interface. WEB ITERFACE STILL SHOWS EVERYTHING ON ONE LINE.
[ ] When sending a message from VS code it looses some history of the chat - seems to keep its own messages but looses old ai agent messages and any from the web client.
[ ] Publish Extension - WHEN ALL ELSE IS DONE!
[X] The updates / overrides seem to be advertised @ /tools though the Configure tools screen on vs code doesnt show that the new description - the ai reports when asked the original description not one recently read in by the reload override method - look here for possible help: https://code.visualstudio.com/blogs/2025/05/12/agent-mode-meets-mcp - FIXED: Implemented onDidChangeMcpServerDefinitions event system to trigger VS Code tool refresh on override file changes and startup
[X] The message formatting from the ai, cariagge returns etc are not observed by the website - its just a big string in one paragraph. Can we fix this? AI message formatting looks fine in vscode interface. WEB INTERFACE STILL SHOWS EVERYTHING ON ONE LINE.
[X] When sending a message from VS code it looses some history of the chat - seems to keep its own messages but looses old ai agent messages and any from the web client.
[ ] Consider how a user might also interact from their mobile phone. Dont want to do port forwarding and setting up web servers etc. How about using telegram as an interface - could this work? Look into it.
[ ] Would be great if I could paste in an image or screen shot - Copilot agent allows this in the vscode plugin.
[ ] put an option in the MCP.json and the global setup to change the default timout to a new value
[X] Getting chat friendly name on startup seems to be failing "[Extension Host] Failed to restore session name: TypeError: fetch failed (at console.<anonymous> (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:203:32117))" - FIXED: Moved session name restoration to after server startup with retry logic
[ ] Publish Extension - WHEN ALL ELSE IS DONE!
+6
View File
@@ -108,6 +108,12 @@
}
]
},
"mcpServerDefinitionProviders": [
{
"id": "humanagent-mcp.server",
"label": "HumanAgent MCP Server"
}
],
"configuration": {
"title": "HumanAgent MCP",
"properties": {
+6
View File
@@ -1,2 +1,8 @@
2025-10-24T08:06:36.164Z - RESPONSE ENDPOINT CALLED - RequestID: 3-1761293186207
2025-10-24T08:25:56.900Z - RESPONSE ENDPOINT CALLED - RequestID: 3-1761294344871
2025-10-24T09:32:10.933Z - RESPONSE ENDPOINT CALLED - RequestID: 3-1761298318952
2025-10-24T09:32:25.510Z - RESPONSE ENDPOINT CALLED - RequestID: 4-1761298337616
2025-10-24T09:33:01.254Z - RESPONSE ENDPOINT CALLED - RequestID: 5-1761298351000
2025-10-24T09:33:44.808Z - RESPONSE ENDPOINT CALLED - RequestID: 8-1761298414137
2025-10-24T09:36:01.128Z - RESPONSE ENDPOINT CALLED - RequestID: 10-1761298555386
2025-10-24T09:36:37.205Z - RESPONSE ENDPOINT CALLED - RequestID: 11-1761298573778
BIN
View File
Binary file not shown.
+54 -4
View File
@@ -13,6 +13,36 @@ let mcpConfigManager: McpConfigManager;
let workspaceSessionId: string;
let serverManager: ServerManager;
// MCP Server Definition Provider for VS Code native MCP integration
class HumanAgentMcpProvider implements vscode.McpServerDefinitionProvider {
private _onDidChangeMcpServerDefinitions = new vscode.EventEmitter<void>();
readonly onDidChangeMcpServerDefinitions = this._onDidChangeMcpServerDefinitions.event;
constructor(private sessionId: string) {}
provideMcpServerDefinitions(token: vscode.CancellationToken): vscode.ProviderResult<vscode.McpHttpServerDefinition[]> {
// Return our HumanAgent MCP server definition with current sessionId
const serverUrl = `http://127.0.0.1:3737/mcp?sessionId=${this.sessionId}`;
const serverUri = vscode.Uri.parse(serverUrl);
const server = new vscode.McpHttpServerDefinition('HumanAgent MCP', serverUri);
return [server];
}
// Method to fire the change event when override files are reloaded
notifyServerDefinitionsChanged(): void {
console.log('HumanAgent MCP: Firing onDidChangeMcpServerDefinitions event');
this._onDidChangeMcpServerDefinitions.fire();
}
// Update session ID when it changes
updateSessionId(newSessionId: string): void {
this.sessionId = newSessionId;
this.notifyServerDefinitionsChanged();
}
}
let mcpProvider: HumanAgentMcpProvider;
// Generate or retrieve persistent workspace session ID
function getWorkspaceSessionId(context: vscode.ExtensionContext): string {
const workspaceRoot = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath;
@@ -72,13 +102,24 @@ export async function activate(context: vscode.ExtensionContext) {
// Generate or retrieve persistent workspace session ID
workspaceSessionId = getWorkspaceSessionId(context);
// Restore the persisted session name for this session ID
await restoreSessionName(context, workspaceSessionId);
// Initialize MCP Configuration Manager
const workspaceRoot = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath;
mcpConfigManager = new McpConfigManager(workspaceRoot, context.extensionPath);
// Initialize and register VS Code native MCP provider
mcpProvider = new HumanAgentMcpProvider(workspaceSessionId);
context.subscriptions.push(vscode.lm.registerMcpServerDefinitionProvider('humanagent-mcp.server', mcpProvider));
console.log('HumanAgent MCP: Registered MCP server definition provider');
// Fire startup event if override file exists to refresh VS Code tools
if (workspaceRoot) {
const overrideFilePath = path.join(workspaceRoot, '.vscode', 'HumanAgentOverride.json');
if (require('fs').existsSync(overrideFilePath)) {
console.log('HumanAgent MCP: Override file detected on startup, firing onDidChangeMcpServerDefinitions');
mcpProvider.notifyServerDefinitionsChanged();
}
}
// Initialize Server Manager
const serverPath = path.join(context.extensionPath, 'dist', 'mcpStandalone.js');
@@ -106,6 +147,15 @@ export async function activate(context: vscode.ExtensionContext) {
// Auto-detect and start standalone MCP server if already configured
await autoStartMcpServer(mcpConfigManager, workspaceSessionId);
// Restore the persisted session name after server is running (with retry)
setTimeout(async () => {
try {
await restoreSessionName(context, workspaceSessionId);
} catch (error) {
console.log('HumanAgent MCP: Could not restore session name on startup (server may not be ready yet):', error);
}
}, 1000); // Wait 1 second for server to fully start
// Initialize Tree View Provider
chatTreeProvider = new ChatTreeProvider();
const treeView = vscode.window.createTreeView('humanagent-mcp.chatSessions', {
@@ -114,7 +164,7 @@ export async function activate(context: vscode.ExtensionContext) {
});
// Initialize Chat Webview Provider (no internal server dependency)
const chatWebviewProvider = new ChatWebviewProvider(context.extensionUri, null, mcpConfigManager, workspaceSessionId, context);
const chatWebviewProvider = new ChatWebviewProvider(context.extensionUri, null, mcpConfigManager, workspaceSessionId, context, mcpProvider);
context.subscriptions.push(
vscode.window.registerWebviewViewProvider(ChatWebviewProvider.viewType, chatWebviewProvider)
);
+1 -92
View File
@@ -16,103 +16,12 @@ class StandaloneMcpServer {
// This ensures log file is created where it can be properly cleared
const workspacePath = require('path').resolve(__dirname, '..');
this.server = new McpServer(undefined, workspacePath);
this.setupProcessHandlers();
}
private setupProcessHandlers(): void {
// Handle STDIO communication for MCP protocol
process.stdin.on('data', async (data) => {
try {
const input = data.toString().trim();
if (!input) {
return;
}
const message = JSON.parse(input);
const response = await this.server.handleMessage(message);
if (response) {
process.stdout.write(JSON.stringify(response) + '\n');
}
} catch (error) {
const errorResponse = {
id: null,
type: 'response',
error: {
code: -32700,
message: 'Parse error',
data: error instanceof Error ? error.message : String(error)
}
};
process.stdout.write(JSON.stringify(errorResponse) + '\n');
}
});
// Handle server events and forward them as notifications
this.server.on('session-created', (session) => {
const notification = {
type: 'notification',
method: 'session/created',
params: { session }
};
process.stdout.write(JSON.stringify(notification) + '\n');
});
this.server.on('message-received', (data) => {
const notification = {
type: 'notification',
method: 'message/received',
params: data
};
process.stdout.write(JSON.stringify(notification) + '\n');
});
this.server.on('message-sent', (data) => {
const notification = {
type: 'notification',
method: 'message/sent',
params: data
};
process.stdout.write(JSON.stringify(notification) + '\n');
});
this.server.on('awaiting-human-response', (data) => {
const notification = {
type: 'notification',
method: 'human/awaiting-response',
params: data
};
process.stdout.write(JSON.stringify(notification) + '\n');
});
// Graceful shutdown handlers removed - server should remain independent
// and only shut down when explicitly requested via API endpoints
// process.on('SIGINT', () => this.shutdown());
// process.on('SIGTERM', () => this.shutdown());
// process.on('exit', () => this.shutdown());
}
async start(): Promise<void> {
try {
await this.server.start();
// Send initialization notification
const initNotification = {
type: 'notification',
method: 'server/started',
params: {
name: 'HumanAgent MCP Server',
version: '1.0.0',
capabilities: {
chat: true,
tools: true,
resources: false
}
}
};
process.stdout.write(JSON.stringify(initNotification) + '\n');
console.error('HumanAgent MCP Server started successfully'); // Use stderr for logging
console.error('HumanAgent MCP Server started successfully (HTTP-only)'); // Use stderr for logging
} catch (error) {
console.error('Failed to start HumanAgent MCP Server:', error);
process.exit(1);
+98 -26
View File
@@ -3,6 +3,7 @@ import * as http from 'http';
import * as fs from 'fs';
import * as path from 'path';
import * as os from 'os';
import * as crypto from 'crypto';
import { McpMessage, McpServerConfig, HumanAgentSession, ChatMessage, McpTool, HumanAgentChatToolParams, HumanAgentChatToolResult } from './types';
import { ChatManager } from './chatManager';
@@ -135,6 +136,7 @@ export class McpServer extends EventEmitter {
private sseConnections: Set<http.ServerResponse> = new Set();
private conversationToSession: Map<string, string> = new Map(); // Map VS Code conversation IDs to registered session IDs
private chatManager: ChatManager; // Centralized chat and session management
private sseClients: Map<string, http.ServerResponse> = new Map(); // Per-session SSE connections
constructor(private sessionId?: string, private workspacePath?: string) {
super();
@@ -193,21 +195,45 @@ export class McpServer extends EventEmitter {
}
}
private sendMcpNotification(method: string, params?: any): void {
// Check if we're in standalone mode (connected via stdio)
if (process.stdout && process.stdout.writable) {
const notification = {
type: 'notification',
method: method,
params: params || {}
};
try {
process.stdout.write(JSON.stringify(notification) + '\n');
this.debugLogger.log('MCP', `Sent MCP notification: ${method}`, params);
} catch (error) {
this.debugLogger.log('ERROR', `Failed to send MCP notification: ${method}`, error);
private sendMcpNotification(method: string, params?: any, sessionId?: string): void {
this.debugLogger.log('MCP', `Sending SSE notification: ${method}`, params);
const notification = {
jsonrpc: '2.0',
method,
params: params || {}
};
if (sessionId) {
// Send to specific session
const sseResponse = this.sseClients.get(sessionId);
if (sseResponse) {
this.debugLogger.log('SSE', `Sending notification to session: ${sessionId}`);
this.sendSSEMessage(sseResponse, notification);
} else {
this.debugLogger.log('SSE', `No SSE connection for session: ${sessionId}`);
}
} else {
// Send to all active sessions with SSE connections
for (const activeSessionId of this.activeSessions) {
const sseResponse = this.sseClients.get(activeSessionId);
if (sseResponse) {
this.debugLogger.log('SSE', `Sending notification to active session: ${activeSessionId}`);
this.sendSSEMessage(sseResponse, notification);
} else {
this.debugLogger.log('SSE', `No SSE connection for active session: ${activeSessionId}`);
}
}
}
}
private sendSSEMessage(response: http.ServerResponse, message: any): void {
try {
const data = JSON.stringify(message);
response.write(`data: ${data}\n\n`);
this.debugLogger.log('SSE', `Sent SSE message: ${message.method || 'response'}`);
} catch (error) {
this.debugLogger.log('ERROR', `Failed to send SSE message:`, error);
}
}
@@ -554,6 +580,18 @@ export class McpServer extends EventEmitter {
if (response) {
res.statusCode = 200;
res.setHeader('Content-Type', 'application/json');
// If this is an initialize response, generate and set session ID
if (message.method === 'initialize') {
// Generate new session ID if none provided in URL
const responseSessionId = sessionId || `session-${crypto.randomUUID()}`;
res.setHeader('Mcp-Session-Id', responseSessionId);
this.debugLogger.log('HTTP', `Set Mcp-Session-Id header: ${responseSessionId}`);
// Add this session to active sessions for notifications
this.activeSessions.add(responseSessionId);
}
const responseJson = JSON.stringify(response);
this.debugLogger.log('HTTP', `Sending 200 response (${responseJson.length} bytes)`);
res.end(responseJson);
@@ -588,6 +626,24 @@ export class McpServer extends EventEmitter {
this.debugLogger.log('SSE', 'Headers:', req.headers);
this.debugLogger.log('SSE', 'URL:', req.url);
// Extract sessionId from query params in URL or Mcp-Session-Id header
const url = new URL(req.url!, `http://${req.headers.host}`);
let sessionId = url.searchParams.get('sessionId');
// If not in URL, try the Mcp-Session-Id header (per MCP spec)
if (!sessionId) {
sessionId = req.headers['mcp-session-id'] as string;
}
if (!sessionId) {
this.debugLogger.log('SSE', 'No sessionId in SSE request (tried URL param and Mcp-Session-Id header)');
this.debugLogger.log('SSE', `Request headers: ${JSON.stringify(req.headers)}`);
this.debugLogger.log('SSE', `Request URL: ${req.url}`);
// For now, let's allow connection without sessionId and use a default
sessionId = 'default-sse-session';
this.debugLogger.log('SSE', `Using default sessionId: ${sessionId}`);
}
// Set up Server-Sent Events (SSE) stream
res.statusCode = 200;
res.setHeader('Content-Type', 'text/event-stream');
@@ -599,15 +655,16 @@ export class McpServer extends EventEmitter {
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Cache-Control, Connection');
this.debugLogger.log('SSE', 'SSE headers set, adding to connections...');
this.debugLogger.log('SSE', `SSE headers set for session ${sessionId}, adding to connections...`);
// Add this connection to our active SSE connections
this.sseConnections.add(res);
this.debugLogger.log('HTTP', `Added SSE connection. Total connections: ${this.sseConnections.size}`);
this.debugLogger.log('SSE', `SSE connection added. Total: ${this.sseConnections.size}`);
// Add this connection to our session-based SSE connections
this.sseClients.set(sessionId, res);
this.sseConnections.add(res); // Keep old connections for cleanup
this.debugLogger.log('HTTP', `Added SSE connection for session ${sessionId}. Total connections: ${this.sseConnections.size}`);
this.debugLogger.log('SSE', `SSE connection added for session ${sessionId}. Total: ${this.sseConnections.size}`);
// Send initial connection acknowledgment
const initialMessage = 'data: {"type":"connection","status":"established"}\n\n';
const initialMessage = 'data: {"type":"connection","status":"established","sessionId":"' + sessionId + '"}\n\n';
res.write(initialMessage);
this.debugLogger.log('SSE', 'Sent initial SSE message:', initialMessage.trim());
@@ -623,10 +680,11 @@ export class McpServer extends EventEmitter {
// Handle client disconnect
const cleanup = () => {
this.debugLogger.log('HTTP', 'SSE connection closed');
this.debugLogger.log('HTTP', `SSE connection closed for session ${sessionId}`);
clearInterval(heartbeat);
this.sseConnections.delete(res);
this.debugLogger.log('HTTP', `Removed SSE connection. Total connections: ${this.sseConnections.size}`);
this.sseClients.delete(sessionId);
this.debugLogger.log('HTTP', `Removed SSE connection for session ${sessionId}. Total connections: ${this.sseConnections.size}`);
};
req.on('close', cleanup);
@@ -890,23 +948,31 @@ export class McpServer extends EventEmitter {
async handleMessage(message: McpMessage): Promise<McpMessage | null> {
this.debugLogger.log('MCP', 'Handling message:', message);
// Extract sessionId from message params if available
const sessionId = message.params?.sessionId;
try {
let response: McpMessage | null = null;
switch (message.method) {
case 'initialize':
this.debugLogger.log('MCP', 'Processing initialize request');
return this.handleInitialize(message);
response = this.handleInitialize(message);
break;
case 'tools/list':
this.debugLogger.log('MCP', 'Processing tools/list request');
return this.handleToolsList(message);
response = this.handleToolsList(message);
break;
case 'tools/call':
this.debugLogger.log('MCP', `Processing tools/call request for tool: ${message.params?.name}`);
return await this.handleToolCall(message);
response = await this.handleToolCall(message);
break;
case 'notifications/initialized':
this.debugLogger.log('MCP', 'Processing notifications/initialized (ignoring)');
return null;
default:
this.debugLogger.log('MCP', `Unknown method: ${message.method}`);
return {
response = {
id: message.id,
type: 'response',
error: {
@@ -915,6 +981,10 @@ export class McpServer extends EventEmitter {
}
};
}
// Notifications are now sent via SSE, no need to include in response
return response;
} catch (error) {
return {
id: message.id,
@@ -1526,6 +1596,8 @@ export class McpServer extends EventEmitter {
}
private handleInitialize(message: McpMessage): McpMessage {
return {
id: message.id,
type: 'response',
+8 -1
View File
@@ -26,7 +26,8 @@ export class ChatWebviewProvider implements vscode.WebviewViewProvider {
mcpServer: McpServer | null,
mcpConfigManager?: McpConfigManager,
private readonly workspaceSessionId?: string,
private readonly context?: vscode.ExtensionContext
private readonly context?: vscode.ExtensionContext,
private readonly mcpProvider?: any
) {
this.mcpServer = mcpServer;
this.mcpConfigManager = mcpConfigManager;
@@ -335,6 +336,12 @@ export class ChatWebviewProvider implements vscode.WebviewViewProvider {
console.error('Failed to call /reload endpoint:', reloadError);
}
// Fire VS Code native MCP event to refresh tools
if (this.mcpProvider) {
this.mcpProvider.notifyServerDefinitionsChanged();
console.log('Fired onDidChangeMcpServerDefinitions event to refresh VS Code tools');
}
vscode.window.showInformationMessage('Override file reloaded successfully!');
} else {
vscode.window.showWarningMessage('Failed to get sessions from server');