Skip to content

Commit 698f401

Browse files
authored
chore: bump mcp-sdk version to 1.10.0 (#83)
chose: bump mcp-sdk version to 1.10.0
1 parent 35a5d40 commit 698f401

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

package-lock.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
],
3232
"dependencies": {
3333
"@apify/log": "^2.5.16",
34-
"@modelcontextprotocol/sdk": "github:jirispilka/mcp-typescript-sdk#fix/add-src-dir",
34+
"@modelcontextprotocol/sdk": "^1.10.0",
3535
"ajv": "^8.17.1",
3636
"apify": "^3.4.0",
3737
"apify-client": "^2.12.1",

src/actor/server.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ export function createExpressApp(
102102
}
103103
});
104104

105+
// express.json() middleware to parse JSON bodies.
106+
// It must be used before the POST /mcp route but after the GET /sse route :shrug:
107+
app.use(express.json());
105108
app.post(Routes.MCP, async (req: Request, res: Response) => {
106109
log.info('Received MCP request:', req.body);
107110
try {

src/mcp/server.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,16 @@ export class ActorsMcpServer {
132132
throw new Error('APIFY_TOKEN is required but not set in the environment variables or passed as a parameter.');
133133
}
134134

135+
// TODO - log errors
136+
// TODO: handle errors better, server.sendLoggingMessage ( )
137+
// TODO - do not raise but return mcp errors
138+
// TODO - if connection is /mcp client will not receive notification on tool change
139+
135140
// Find tool by name or actor full name
136141
const tool = Array.from(this.tools.values())
137142
.find((t) => t.tool.name === name || (t.type === 'actor' && (t.tool as ActorTool).actorFullName === name));
138143
if (!tool) {
139-
// TODO: handle errors better, server.sendLoggingMessage ( )
144+
await this.server.sendLoggingMessage({ level: 'info', data: `Unknown tool $\{name}, available tools ${this.getToolNames()}` });
140145
throw new Error(`Unknown tool: ${name}`);
141146
}
142147
if (!args) {

0 commit comments

Comments
 (0)