Upload Source/Plugin/McpServer.cpp
Browse files
Source/Plugin/McpServer.cpp
CHANGED
|
@@ -83,7 +83,7 @@ std::string McpServer::handleInitialize(const std::string& requestBody)
|
|
| 83 |
sessionId = "pb-" + std::to_string(std::chrono::steady_clock::now().time_since_epoch().count());
|
| 84 |
json response = {{"jsonrpc","2.0"},{"id",body.value("id",json(nullptr))},
|
| 85 |
{"result",{{"protocolVersion","2025-06-18"},{"capabilities",{{"tools",{{"listChanged",false}}}}},
|
| 86 |
-
{"serverInfo",{{"name","PluginBridge"},{"version","0.
|
| 87 |
return response.dump();
|
| 88 |
}
|
| 89 |
|
|
@@ -96,7 +96,7 @@ std::string McpServer::handleToolsList(const std::string& requestBody)
|
|
| 96 |
{{"name","search_param"},{"description","Search params by keyword"},{"inputSchema",{{"type","object"},{"properties",{{"keyword",{{"type","string"}}}}},{"required",json::array({"keyword"})}}}},
|
| 97 |
{{"name","get_params"},{"description","Get param values by index"},{"inputSchema",{{"type","object"},{"properties",{{"ids",{{"type","array"},{"items",{{"type","integer"}}}}}}},{"required",json::array({"ids"})}}}},
|
| 98 |
{{"name","set_params"},{"description","Set params (batch, 0.0-1.0)"},{"inputSchema",{{"type","object"},{"properties",{{"values",{{"type","object"}}}}},{"required",json::array({"values"})}}}},
|
| 99 |
-
{{"name","get_analysis"},{"description","Real-time audio analysis"},{"inputSchema",{{"type","object"},{"properties",json::object()}}}}
|
| 100 |
})}}}};
|
| 101 |
return response.dump();
|
| 102 |
}
|
|
@@ -143,7 +143,10 @@ std::string McpServer::handleToolsCall(const std::string& requestBody)
|
|
| 143 |
}
|
| 144 |
else if (toolName == "get_analysis")
|
| 145 |
{
|
| 146 |
-
|
|
|
|
|
|
|
|
|
|
| 147 |
}
|
| 148 |
else
|
| 149 |
{
|
|
|
|
| 83 |
sessionId = "pb-" + std::to_string(std::chrono::steady_clock::now().time_since_epoch().count());
|
| 84 |
json response = {{"jsonrpc","2.0"},{"id",body.value("id",json(nullptr))},
|
| 85 |
{"result",{{"protocolVersion","2025-06-18"},{"capabilities",{{"tools",{{"listChanged",false}}}}},
|
| 86 |
+
{"serverInfo",{{"name","PluginBridge"},{"version","0.5.2"}}}}}};
|
| 87 |
return response.dump();
|
| 88 |
}
|
| 89 |
|
|
|
|
| 96 |
{{"name","search_param"},{"description","Search params by keyword"},{"inputSchema",{{"type","object"},{"properties",{{"keyword",{{"type","string"}}}}},{"required",json::array({"keyword"})}}}},
|
| 97 |
{{"name","get_params"},{"description","Get param values by index"},{"inputSchema",{{"type","object"},{"properties",{{"ids",{{"type","array"},{"items",{{"type","integer"}}}}}}},{"required",json::array({"ids"})}}}},
|
| 98 |
{{"name","set_params"},{"description","Set params (batch, 0.0-1.0)"},{"inputSchema",{{"type","object"},{"properties",{{"values",{{"type","object"}}}}},{"required",json::array({"values"})}}}},
|
| 99 |
+
{{"name","get_analysis"},{"description","Real-time audio analysis: LUFS, true peak, 7-band balance, stereo width, brightness. Returns compact string."},{"inputSchema",{{"type","object"},{"properties",json::object()}}}}
|
| 100 |
})}}}};
|
| 101 |
return response.dump();
|
| 102 |
}
|
|
|
|
| 143 |
}
|
| 144 |
else if (toolName == "get_analysis")
|
| 145 |
{
|
| 146 |
+
if (getAnalysisCallback)
|
| 147 |
+
resultText = getAnalysisCallback();
|
| 148 |
+
else
|
| 149 |
+
resultText = "analyser not ready";
|
| 150 |
}
|
| 151 |
else
|
| 152 |
{
|