@solongate/proxy 0.1.9 → 0.1.11
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/create.js +2 -17
- package/dist/index.js +2 -17
- package/package.json +1 -1
package/dist/create.js
CHANGED
|
@@ -141,6 +141,7 @@ function createProject(dir, name, _policy) {
|
|
|
141
141
|
zod: "^3.25.0"
|
|
142
142
|
},
|
|
143
143
|
devDependencies: {
|
|
144
|
+
"@types/node": "^22.0.0",
|
|
144
145
|
tsup: "^8.3.0",
|
|
145
146
|
tsx: "^4.19.0",
|
|
146
147
|
typescript: "^5.7.0"
|
|
@@ -176,7 +177,6 @@ function createProject(dir, name, _policy) {
|
|
|
176
177
|
join(dir, "src", "index.ts"),
|
|
177
178
|
`#!/usr/bin/env node
|
|
178
179
|
|
|
179
|
-
// MCP uses stdout for JSON-RPC \u2014 redirect console to stderr
|
|
180
180
|
console.log = (...args: unknown[]) => {
|
|
181
181
|
process.stderr.write(args.map(String).join(' ') + '\\n');
|
|
182
182
|
};
|
|
@@ -185,35 +185,20 @@ import { SecureMcpServer } from '@solongate/sdk';
|
|
|
185
185
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
186
186
|
import { z } from 'zod';
|
|
187
187
|
|
|
188
|
-
// Create a secure MCP server (API key from SOLONGATE_API_KEY env var)
|
|
189
188
|
const server = new SecureMcpServer({
|
|
190
189
|
name: '${name}',
|
|
191
190
|
version: '0.1.0',
|
|
192
191
|
});
|
|
193
192
|
|
|
194
|
-
// \u2500\u2500 Register your tools below \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
195
|
-
|
|
196
193
|
server.tool(
|
|
197
194
|
'hello',
|
|
198
195
|
'Say hello to someone',
|
|
199
196
|
{ name: z.string().describe('Name of the person to greet') },
|
|
200
|
-
async ({ name }) => ({
|
|
197
|
+
async ({ name }: { name: string }) => ({
|
|
201
198
|
content: [{ type: 'text', text: \`Hello, \${name}! Welcome to ${name}.\` }],
|
|
202
199
|
}),
|
|
203
200
|
);
|
|
204
201
|
|
|
205
|
-
// Example: Add more tools here
|
|
206
|
-
// server.tool(
|
|
207
|
-
// 'read_data',
|
|
208
|
-
// 'Read data from a source',
|
|
209
|
-
// { query: z.string().describe('What to read') },
|
|
210
|
-
// async ({ query }) => ({
|
|
211
|
-
// content: [{ type: 'text', text: \`Result for: \${query}\` }],
|
|
212
|
-
// }),
|
|
213
|
-
// );
|
|
214
|
-
|
|
215
|
-
// \u2500\u2500 Start the server \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
216
|
-
|
|
217
202
|
const transport = new StdioServerTransport();
|
|
218
203
|
await server.connect(transport);
|
|
219
204
|
console.log('${name} is running');
|
package/dist/index.js
CHANGED
|
@@ -802,6 +802,7 @@ function createProject(dir, name, _policy) {
|
|
|
802
802
|
zod: "^3.25.0"
|
|
803
803
|
},
|
|
804
804
|
devDependencies: {
|
|
805
|
+
"@types/node": "^22.0.0",
|
|
805
806
|
tsup: "^8.3.0",
|
|
806
807
|
tsx: "^4.19.0",
|
|
807
808
|
typescript: "^5.7.0"
|
|
@@ -837,7 +838,6 @@ function createProject(dir, name, _policy) {
|
|
|
837
838
|
join2(dir, "src", "index.ts"),
|
|
838
839
|
`#!/usr/bin/env node
|
|
839
840
|
|
|
840
|
-
// MCP uses stdout for JSON-RPC \u2014 redirect console to stderr
|
|
841
841
|
console.log = (...args: unknown[]) => {
|
|
842
842
|
process.stderr.write(args.map(String).join(' ') + '\\n');
|
|
843
843
|
};
|
|
@@ -846,35 +846,20 @@ import { SecureMcpServer } from '@solongate/sdk';
|
|
|
846
846
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
847
847
|
import { z } from 'zod';
|
|
848
848
|
|
|
849
|
-
// Create a secure MCP server (API key from SOLONGATE_API_KEY env var)
|
|
850
849
|
const server = new SecureMcpServer({
|
|
851
850
|
name: '${name}',
|
|
852
851
|
version: '0.1.0',
|
|
853
852
|
});
|
|
854
853
|
|
|
855
|
-
// \u2500\u2500 Register your tools below \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
856
|
-
|
|
857
854
|
server.tool(
|
|
858
855
|
'hello',
|
|
859
856
|
'Say hello to someone',
|
|
860
857
|
{ name: z.string().describe('Name of the person to greet') },
|
|
861
|
-
async ({ name }) => ({
|
|
858
|
+
async ({ name }: { name: string }) => ({
|
|
862
859
|
content: [{ type: 'text', text: \`Hello, \${name}! Welcome to ${name}.\` }],
|
|
863
860
|
}),
|
|
864
861
|
);
|
|
865
862
|
|
|
866
|
-
// Example: Add more tools here
|
|
867
|
-
// server.tool(
|
|
868
|
-
// 'read_data',
|
|
869
|
-
// 'Read data from a source',
|
|
870
|
-
// { query: z.string().describe('What to read') },
|
|
871
|
-
// async ({ query }) => ({
|
|
872
|
-
// content: [{ type: 'text', text: \`Result for: \${query}\` }],
|
|
873
|
-
// }),
|
|
874
|
-
// );
|
|
875
|
-
|
|
876
|
-
// \u2500\u2500 Start the server \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
877
|
-
|
|
878
863
|
const transport = new StdioServerTransport();
|
|
879
864
|
await server.connect(transport);
|
|
880
865
|
console.log('${name} is running');
|
package/package.json
CHANGED