mirror of
https://github.com/run-llama/mcp-server-llamacloud.git
synced 2026-06-30 20:47:54 -04:00
fix: send startup logs to stderr to keep stdout JSON-only (#7)
This commit is contained in:
committed by
GitHub
parent
5b07690eca
commit
4456188af0
+3
-1
@@ -1,4 +1,6 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
build/
|
build/
|
||||||
*.log
|
*.log
|
||||||
.env*
|
.env*
|
||||||
|
# Do not push Morgan prompts
|
||||||
|
src/Morgan/prompts/
|
||||||
|
|||||||
+8
-4
@@ -117,8 +117,8 @@ for (const definition of toolDefinitions) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
indexes.set(definition.toolName!, index);
|
indexes.set(definition.toolName!, index);
|
||||||
console.log(
|
process.stderr.write(
|
||||||
`Created index for tool ${definition.toolName}: ${definition.indexName} - ${definition.description}`,
|
`Created index for tool ${definition.toolName}: ${definition.indexName} - ${definition.description}\n`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,9 +185,13 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|||||||
* This allows the server to communicate via standard input/output streams.
|
* This allows the server to communicate via standard input/output streams.
|
||||||
*/
|
*/
|
||||||
async function main() {
|
async function main() {
|
||||||
console.log(`Starting MCP server with ${toolDefinitions.length} tools:`);
|
process.stderr.write(
|
||||||
|
`Starting MCP server with ${toolDefinitions.length} tools:\n`,
|
||||||
|
);
|
||||||
toolDefinitions.forEach((def) => {
|
toolDefinitions.forEach((def) => {
|
||||||
console.log(`- ${def.toolName}: ${def.indexName} - ${def.description}`);
|
process.stderr.write(
|
||||||
|
`- ${def.toolName}: ${def.indexName} - ${def.description}\n`,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const transport = new StdioServerTransport();
|
const transport = new StdioServerTransport();
|
||||||
|
|||||||
Reference in New Issue
Block a user