Skip to content

Commit 115de27

Browse files
committed
Added stdio support and tested with Cursor
1 parent 3744085 commit 115de27

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

mcp-openapi/tests/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ describe('Banking API Examples Tests', () => {
193193
o.specId === 'banking-payments' && o.path === '/v1/banking/payments'
194194
);
195195
expect(paymentOverride).toBeDefined();
196-
expect(paymentOverride.type).toBe('resource');
196+
expect(paymentOverride.type).toBe('tool');
197197
});
198198
});
199199

mcp-openapi/tests/integration.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ describe('MCP OpenAPI Server Integration Tests', () => {
5757
expect(toolNames.some((name: string) => name.includes('banking-payees_update'))).toBe(true);
5858
expect(toolNames.some((name: string) => name.includes('banking-payees_delete'))).toBe(true);
5959

60-
// Note: The payments GET endpoint is configured as a resource, not a tool, due to override configuration
60+
// Note: The payments GET endpoint is now configured as a tool due to Cursor compatibility requirements
6161
});
6262

6363
test('should generate correct resources from banking APIs', () => {
6464
const resources = (server as any).resources;
6565
const resourceUris = resources.map((r: any) => r.uri);
6666

6767
expect(resourceUris.some((uri: string) => uri.includes('banking-products://'))).toBe(true);
68-
expect(resourceUris.some((uri: string) => uri.includes('banking-payees://'))).toBe(true);
68+
// Note: banking-payees and banking-payments are now configured as tools, not resources
6969
});
7070

7171
test('should load custom prompts correctly', () => {
@@ -215,12 +215,12 @@ describe('MCP OpenAPI Server Integration Tests', () => {
215215
});
216216

217217
test('should apply configuration overrides correctly', () => {
218-
const resources = (server as any).resources;
218+
const tools = (server as any).tools;
219219

220-
// Check that the GET payments endpoint is configured as a resource due to override
221-
const paymentsResource = resources.find((r: any) => r.uri.includes('banking-payments://v1/banking/payments'));
222-
expect(paymentsResource).toBeDefined();
223-
expect(paymentsResource.description).toContain('Search payments');
220+
// Check that the GET payments endpoint is configured as a tool due to override (changed from resource for Cursor compatibility)
221+
const paymentsTool = tools.find((t: any) => t.name.includes('banking-payments_get_payments'));
222+
expect(paymentsTool).toBeDefined();
223+
expect(paymentsTool.description).toContain('Search payments');
224224
});
225225

226226
test('should load configuration from file correctly', () => {
@@ -399,7 +399,7 @@ describe('MCP OpenAPI Server Integration Tests', () => {
399399
// Verify the resources list is populated correctly
400400
expect(expectedResult.resources.length).toBeGreaterThan(0);
401401
expect(expectedResult.resources.some((resource: any) => resource.uri.includes('banking-products://'))).toBe(true);
402-
expect(expectedResult.resources.some((resource: any) => resource.uri.includes('banking-payees://'))).toBe(true);
402+
// Note: banking-payees are now configured as tools, not resources
403403

404404
// Ensure each resource has required properties
405405
expectedResult.resources.forEach((resource: any) => {

0 commit comments

Comments
 (0)