mirror of
https://github.com/run-llama/mcp-server-llamacloud.git
synced 2026-07-01 20:35:21 -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/
|
||||
build/
|
||||
*.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);
|
||||
console.log(
|
||||
`Created index for tool ${definition.toolName}: ${definition.indexName} - ${definition.description}`,
|
||||
process.stderr.write(
|
||||
`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.
|
||||
*/
|
||||
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) => {
|
||||
console.log(`- ${def.toolName}: ${def.indexName} - ${def.description}`);
|
||||
process.stderr.write(
|
||||
`- ${def.toolName}: ${def.indexName} - ${def.description}\n`,
|
||||
);
|
||||
});
|
||||
|
||||
const transport = new StdioServerTransport();
|
||||
|
||||
Reference in New Issue
Block a user