Skip to content

Commit 9442917

Browse files
authored
Merge pull request #13 from StuMason/feature/mcp-resources
feat: implement MCP Resource decorator
2 parents f4b5ba0 + b1f7681 commit 9442917

16 files changed

+641
-469
lines changed

README.md

Lines changed: 132 additions & 243 deletions
Large diffs are not rendered by default.

package-lock.json

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

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"lint": "eslint . --ext .ts",
2121
"lint:fix": "eslint . --ext .ts --fix",
2222
"format": "prettier --write .",
23+
"format:check": "prettier --check .",
2324
"prepare": "husky",
2425
"prepublishOnly": "npm test && npm run lint",
2526
"start": "node dist/index.js"
@@ -33,6 +34,7 @@
3334
"license": "MIT",
3435
"dependencies": {
3536
"@modelcontextprotocol/sdk": "^1.6.1",
37+
"reflect-metadata": "^0.2.2",
3638
"zod": "^3.24.2"
3739
},
3840
"devDependencies": {
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { ApplicationResources } from '../../resources/application-resources.js';
2+
import { CoolifyClient } from '../../lib/coolify-client.js';
3+
4+
jest.mock('../../lib/coolify-client.js');
5+
6+
describe('ApplicationResources', () => {
7+
let resources: ApplicationResources;
8+
let mockClient: jest.Mocked<CoolifyClient>;
9+
10+
beforeEach(() => {
11+
mockClient = new CoolifyClient({
12+
baseUrl: 'http://test.coolify.io',
13+
accessToken: 'test-token',
14+
}) as jest.Mocked<CoolifyClient>;
15+
resources = new ApplicationResources(mockClient);
16+
});
17+
18+
describe('listApplications', () => {
19+
it('should throw not implemented error', async () => {
20+
await expect(resources.listApplications()).rejects.toThrow('Not implemented');
21+
});
22+
});
23+
24+
describe('getApplication', () => {
25+
it('should throw not implemented error', async () => {
26+
await expect(resources.getApplication('test-id')).rejects.toThrow('Not implemented');
27+
});
28+
});
29+
30+
describe('createApplication', () => {
31+
it('should throw not implemented error', async () => {
32+
await expect(resources.createApplication({ name: 'test-app' })).rejects.toThrow(
33+
'Not implemented',
34+
);
35+
});
36+
});
37+
38+
describe('deleteApplication', () => {
39+
it('should throw not implemented error', async () => {
40+
await expect(resources.deleteApplication('test-id')).rejects.toThrow('Not implemented');
41+
});
42+
});
43+
});

0 commit comments

Comments
 (0)