@runsnative/mcp-server 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
1
3
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
4
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
5
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
@@ -21,7 +23,12 @@ const provider = await createProvider();
|
|
|
21
23
|
if (provider instanceof RemoteContentProvider) {
|
|
22
24
|
await provider.initialize();
|
|
23
25
|
}
|
|
24
|
-
|
|
26
|
+
// Advertised version reads package.json at runtime — a literal here drifts
|
|
27
|
+
// the moment the next release forgets to update it (0.3.0 survived four
|
|
28
|
+
// releases; 0.1.4 outlived its release within hours).
|
|
29
|
+
const require = createRequire(import.meta.url);
|
|
30
|
+
const { version: pkgVersion } = require('../package.json');
|
|
31
|
+
const server = new Server({ name: 'runsnative-mcp', version: pkgVersion }, { capabilities: { tools: {} } });
|
|
25
32
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
26
33
|
tools: [
|
|
27
34
|
GET_COMPONENT_TOOL,
|