Skip to content

Commit 8c88f94

Browse files
committed
Configure smithery
1 parent 64ec448 commit 8c88f94

6 files changed

Lines changed: 37 additions & 13 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
mcp.json
22
node_modules/
33
dist/
4+
.smithery/
45
.yarn/*
56
!.yarn/patches
67
!.yarn/plugins

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"typescript"
3131
],
3232
"type": "module",
33+
"module": "src/smithery.ts",
3334
"bin": "dist/cli.js",
3435
"files": [
3536
"dist"
@@ -42,7 +43,7 @@
4243
},
4344
"packageManager": "yarn@4.9.2",
4445
"dependencies": {
45-
"@modelcontextprotocol/sdk": "^1.0.4",
46+
"@modelcontextprotocol/sdk": "^1.18.2",
4647
"axios": "^1.12.2",
4748
"zod": "^3.25.76"
4849
},

smithery.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
runtime: "typescript"

src/server.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@ import { AxiosInstance } from "axios";
1111
import createPlainlyClient, { PlainlySdk } from "./sdk";
1212

1313
export class PlainlyMcpServer {
14-
server: McpServer;
14+
mcpServer: McpServer;
1515

1616
constructor(private readonly apiClient: AxiosInstance) {
17-
this.server = new McpServer({
17+
this.mcpServer = new McpServer({
1818
name: PACKAGE_NAME,
1919
version: PACKAGE_VERSION,
2020
});
2121
const plainlySdk: PlainlySdk = createPlainlyClient(this.apiClient);
2222

2323
// Register tools
24-
registerListRenderableItems(plainlySdk, this.server);
25-
registerGetRenderableItemDetails(plainlySdk, this.server);
26-
registerRenderItem(plainlySdk, this.server);
27-
registerCheckRenderStatus(plainlySdk, this.server);
24+
registerListRenderableItems(plainlySdk, this.mcpServer);
25+
registerGetRenderableItemDetails(plainlySdk, this.mcpServer);
26+
registerRenderItem(plainlySdk, this.mcpServer);
27+
registerCheckRenderStatus(plainlySdk, this.mcpServer);
2828
}
2929

3030
async startStdio() {
3131
// Start the stdio server
3232
const transport = new StdioServerTransport();
33-
await this.server.connect(transport);
33+
await this.mcpServer.connect(transport);
3434
}
3535
}

src/smithery.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { z } from "zod";
2+
import { PlainlyMcpServer } from "./server";
3+
import env from "./env";
4+
import { createApiClient } from "./axiosConfig";
5+
6+
export default function createServer({
7+
config,
8+
}: {
9+
config: z.infer<typeof configSchema>;
10+
}) {
11+
const apiClient = createApiClient({
12+
baseUrl: env.PLAINLY_API_URL,
13+
apiKey: config.apiKey,
14+
});
15+
const plainlyServer = new PlainlyMcpServer(apiClient);
16+
return plainlyServer.mcpServer.server;
17+
}
18+
19+
export const configSchema = z.object({
20+
apiKey: z.string().describe("Your Plainly API key."),
21+
});

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ __metadata:
210210
languageName: node
211211
linkType: hard
212212

213-
"@modelcontextprotocol/sdk@npm:^1.0.4":
214-
version: 1.18.1
215-
resolution: "@modelcontextprotocol/sdk@npm:1.18.1"
213+
"@modelcontextprotocol/sdk@npm:^1.18.2":
214+
version: 1.18.2
215+
resolution: "@modelcontextprotocol/sdk@npm:1.18.2"
216216
dependencies:
217217
ajv: "npm:^6.12.6"
218218
content-type: "npm:^1.0.5"
@@ -226,7 +226,7 @@ __metadata:
226226
raw-body: "npm:^3.0.0"
227227
zod: "npm:^3.23.8"
228228
zod-to-json-schema: "npm:^3.24.1"
229-
checksum: 10c0/86849684f31932d4f1424f7e86dda6d0a3b308ad828790c0c052f381c57622829f8b86ad5cc0786d80c834ea113d7033398660e7327585db095fcaf6c4bc2ce0
229+
checksum: 10c0/f0cb7a97ff264cbd389753b038c7dd197f359445324a7d4eb1d8e9be2cfb1e19d6375a12098cdd71c06847e9978c976950fc17f8d4f5e7778dd99d6f9416a48e
230230
languageName: node
231231
linkType: hard
232232

@@ -263,7 +263,7 @@ __metadata:
263263
version: 0.0.0-use.local
264264
resolution: "@plainly-videos/mcp-server@workspace:."
265265
dependencies:
266-
"@modelcontextprotocol/sdk": "npm:^1.0.4"
266+
"@modelcontextprotocol/sdk": "npm:^1.18.2"
267267
"@types/node": "npm:^22.10.6"
268268
axios: "npm:^1.12.2"
269269
typescript: "npm:^5.7.3"

0 commit comments

Comments
 (0)