Skip to content

Commit 58d1eca

Browse files
committed
chore: spaces instead of tabs
1 parent c8b467f commit 58d1eca

File tree

8 files changed

+176
-175
lines changed

8 files changed

+176
-175
lines changed

.vscode/settings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"files.associations": {
3-
"wrangler.json": "jsonc"
4-
}
2+
"files.associations": {
3+
"wrangler.json": "jsonc"
4+
}
55
}

biome.json

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.6.2/schema.json",
3-
"organizeImports": {
4-
"enabled": true
5-
},
6-
"files": {
7-
"ignore": ["worker-configuration.d.ts"]
8-
},
9-
"vcs": {
10-
"enabled": true,
11-
"clientKind": "git",
12-
"useIgnoreFile": true
13-
},
14-
"linter": {
15-
"enabled": true,
16-
"rules": {
17-
"recommended": true,
18-
"suspicious": {
19-
"noExplicitAny": "off",
20-
"noDebugger": "off",
21-
"noConsoleLog": "off",
22-
"noConfusingVoidType": "off"
23-
},
24-
"style": {
25-
"noNonNullAssertion": "off",
26-
"useTemplate": "warn"
27-
}
28-
}
29-
},
30-
"formatter": {
31-
"enabled": true,
32-
"indentWidth": 2,
33-
"lineWidth": 100
34-
}
2+
"$schema": "https://biomejs.dev/schemas/1.6.2/schema.json",
3+
"organizeImports": {
4+
"enabled": true
5+
},
6+
"files": {
7+
"ignore": ["worker-configuration.d.ts"]
8+
},
9+
"vcs": {
10+
"enabled": true,
11+
"clientKind": "git",
12+
"useIgnoreFile": true
13+
},
14+
"linter": {
15+
"enabled": true,
16+
"rules": {
17+
"recommended": true,
18+
"suspicious": {
19+
"noExplicitAny": "off",
20+
"noDebugger": "off",
21+
"noConsoleLog": "off",
22+
"noConfusingVoidType": "off"
23+
},
24+
"style": {
25+
"noNonNullAssertion": "off",
26+
"useTemplate": "warn"
27+
}
28+
}
29+
},
30+
"formatter": {
31+
"enabled": true,
32+
"indentWidth": 2,
33+
"indentStyle": "space",
34+
"lineWidth": 100
35+
}
3536
}

package.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2-
"name": "remote-mcp-server-authless",
3-
"version": "0.0.0",
4-
"private": true,
5-
"scripts": {
6-
"deploy": "wrangler deploy",
7-
"dev": "wrangler dev",
8-
"format": "biome format --write",
9-
"lint": "biome lint",
10-
"start": "wrangler dev",
11-
"cf-typegen": "wrangler types",
12-
"type-check": "tsc --noEmit"
13-
},
14-
"dependencies": {
15-
"@modelcontextprotocol/sdk": "^1.12.0",
16-
"agents": "^0.0.93",
17-
"http-status-codes": "^2.3.0",
18-
"zod": "^3.25.28"
19-
},
20-
"devDependencies": {
21-
"@biomejs/biome": "^1.9.4",
22-
"@types/node": "^22.15.21",
23-
"typescript": "^5.8.3",
24-
"wrangler": "^4.16.1"
25-
}
2+
"name": "remote-mcp-server-authless",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"deploy": "wrangler deploy",
7+
"dev": "wrangler dev",
8+
"format": "biome format --write",
9+
"lint": "biome lint",
10+
"start": "wrangler dev",
11+
"cf-typegen": "wrangler types",
12+
"type-check": "tsc --noEmit"
13+
},
14+
"dependencies": {
15+
"@modelcontextprotocol/sdk": "^1.12.0",
16+
"agents": "^0.0.93",
17+
"http-status-codes": "^2.3.0",
18+
"zod": "^3.25.28"
19+
},
20+
"devDependencies": {
21+
"@biomejs/biome": "^1.9.4",
22+
"@types/node": "^22.15.21",
23+
"typescript": "^5.8.3",
24+
"wrangler": "^4.16.1"
25+
}
2626
}

src/index.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@ import HttpStatus from "http-status-codes";
55
import * as getDefinition from "@/tools/getDefinition";
66

77
export class MyMCP extends McpAgent {
8-
server = new McpServer({
9-
name: "Dexonline MCP Server",
10-
description: "An MCP interface for accessing Romanian dictionary data via the Dexonline API",
11-
version: "0.1.0",
12-
});
8+
server = new McpServer({
9+
name: "Dexonline MCP Server",
10+
description: "An MCP interface for accessing Romanian dictionary data via the Dexonline API",
11+
version: "0.1.0",
12+
});
1313

14-
async init() {
15-
this.server.tool(getDefinition.name, getDefinition.schema, getDefinition.handler);
16-
}
14+
async init() {
15+
this.server.tool(getDefinition.name, getDefinition.schema, getDefinition.handler);
16+
}
1717
}
1818

1919
export default {
20-
fetch(request: Request, env: Env, ctx: ExecutionContext) {
21-
const url = new URL(request.url);
20+
fetch(request: Request, env: Env, ctx: ExecutionContext) {
21+
const url = new URL(request.url);
2222

23-
if (url.pathname === "/sse" || url.pathname === "/sse/message") {
24-
return MyMCP.serveSSE("/sse").fetch(request, env, ctx);
25-
}
26-
if (url.pathname === "/mcp") {
27-
return MyMCP.serve("/mcp").fetch(request, env, ctx);
28-
}
29-
return new Response("Not found", { status: HttpStatus.NOT_FOUND });
30-
},
23+
if (url.pathname === "/sse" || url.pathname === "/sse/message") {
24+
return MyMCP.serveSSE("/sse").fetch(request, env, ctx);
25+
}
26+
if (url.pathname === "/mcp") {
27+
return MyMCP.serve("/mcp").fetch(request, env, ctx);
28+
}
29+
return new Response("Not found", { status: HttpStatus.NOT_FOUND });
30+
},
3131
};

src/tools/getDefinition.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@ import { z } from "zod";
33
import { respond } from "@/utils/helpers";
44

55
type DexApiResponse = {
6-
word: string | undefined;
7-
definitions: string[];
6+
word: string | undefined;
7+
definitions: string[];
88
};
99

1010
export const name = "getDefinition";
1111
export const url = "https://dexonline.ro/definitie/";
1212

1313
export const schema = {
14-
query: z.string().describe("The word to look up in the dictionary"),
14+
query: z.string().describe("The word to look up in the dictionary"),
1515
};
1616

1717
export const handler = async (input: { query: string }) => {
18-
try {
19-
const result = await fetch(url + input.query + "/json");
20-
const data: DexApiResponse = await result.json();
18+
try {
19+
const result = await fetch(url + input.query + "/json");
20+
const data: DexApiResponse = await result.json();
2121

22-
if (data?.word) {
23-
return respond(data.definitions);
24-
}
25-
return respond("I couldn’t find a definition");
26-
} catch {
27-
return respond("An error occurred while fetching the definition");
28-
}
22+
if (data?.word) {
23+
return respond(data.definitions);
24+
}
25+
return respond("I couldn’t find a definition");
26+
} catch {
27+
return respond("An error occurred while fetching the definition");
28+
}
2929
};

src/utils/helpers.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
export const respond = (content: string | string[]) => {
2-
if (Array.isArray(content)) {
3-
return {
4-
content: content.map((text) => {
5-
return { type: "text" as const, text };
6-
}),
7-
};
8-
}
9-
return {
10-
content: [{ type: "text" as const, text: content }],
11-
};
2+
if (Array.isArray(content)) {
3+
return {
4+
content: content.map((text) => {
5+
return { type: "text" as const, text };
6+
}),
7+
};
8+
}
9+
return {
10+
content: [{ type: "text" as const, text: content }],
11+
};
1212
};

tsconfig.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
{
2-
"compilerOptions": {
3-
"baseUrl": "./src",
4-
"paths": {
5-
"@/*": ["./*"]
6-
},
7-
"target": "es2021",
8-
"lib": ["es2021"],
9-
"jsx": "react-jsx",
10-
"module": "es2022",
11-
"moduleResolution": "Bundler",
12-
"resolveJsonModule": true,
13-
"allowJs": true,
14-
"checkJs": false,
15-
"noEmit": true,
16-
"isolatedModules": true,
17-
"allowSyntheticDefaultImports": true,
18-
"forceConsistentCasingInFileNames": true,
19-
"strict": true,
20-
"skipLibCheck": true,
21-
"types": ["./worker-configuration.d.ts", "node"]
22-
},
23-
"include": ["worker-configuration.d.ts", "src/**/*.ts"]
2+
"compilerOptions": {
3+
"baseUrl": "./src",
4+
"paths": {
5+
"@/*": ["./*"]
6+
},
7+
"target": "es2021",
8+
"lib": ["es2021"],
9+
"jsx": "react-jsx",
10+
"module": "es2022",
11+
"moduleResolution": "Bundler",
12+
"resolveJsonModule": true,
13+
"allowJs": true,
14+
"checkJs": false,
15+
"noEmit": true,
16+
"isolatedModules": true,
17+
"allowSyntheticDefaultImports": true,
18+
"forceConsistentCasingInFileNames": true,
19+
"strict": true,
20+
"skipLibCheck": true,
21+
"types": ["./worker-configuration.d.ts", "node"]
22+
},
23+
"include": ["worker-configuration.d.ts", "src/**/*.ts"]
2424
}

wrangler.jsonc

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,60 +3,60 @@
33
* https://developers.cloudflare.com/workers/wrangler/configuration/
44
*/
55
{
6-
"$schema": "node_modules/wrangler/config-schema.json",
7-
"name": "dexonline-mcp-server",
8-
"main": "src/index.ts",
9-
"compatibility_date": "2025-03-10",
10-
"compatibility_flags": ["nodejs_compat"],
11-
"migrations": [
12-
{
13-
"new_sqlite_classes": ["MyMCP"],
14-
"tag": "v1"
15-
}
16-
],
17-
"durable_objects": {
18-
"bindings": [
19-
{
20-
"class_name": "MyMCP",
21-
"name": "MCP_OBJECT"
22-
}
23-
]
24-
},
25-
"observability": {
26-
"enabled": true
27-
}
28-
/**
29-
* Smart Placement
30-
* Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
31-
*/
32-
// "placement": { "mode": "smart" },
6+
"$schema": "node_modules/wrangler/config-schema.json",
7+
"name": "dexonline-mcp-server",
8+
"main": "src/index.ts",
9+
"compatibility_date": "2025-03-10",
10+
"compatibility_flags": ["nodejs_compat"],
11+
"migrations": [
12+
{
13+
"new_sqlite_classes": ["MyMCP"],
14+
"tag": "v1"
15+
}
16+
],
17+
"durable_objects": {
18+
"bindings": [
19+
{
20+
"class_name": "MyMCP",
21+
"name": "MCP_OBJECT"
22+
}
23+
]
24+
},
25+
"observability": {
26+
"enabled": true
27+
}
28+
/**
29+
* Smart Placement
30+
* Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
31+
*/
32+
// "placement": { "mode": "smart" },
3333

34-
/**
35-
* Bindings
36-
* Bindings allow your Worker to interact with resources on the Cloudflare Developer Platform, including
37-
* databases, object storage, AI inference, real-time communication and more.
38-
* https://developers.cloudflare.com/workers/runtime-apis/bindings/
39-
*/
34+
/**
35+
* Bindings
36+
* Bindings allow your Worker to interact with resources on the Cloudflare Developer Platform, including
37+
* databases, object storage, AI inference, real-time communication and more.
38+
* https://developers.cloudflare.com/workers/runtime-apis/bindings/
39+
*/
4040

41-
/**
42-
* Environment Variables
43-
* https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
44-
*/
45-
// "vars": { "MY_VARIABLE": "production_value" },
46-
/**
47-
* Note: Use secrets to store sensitive data.
48-
* https://developers.cloudflare.com/workers/configuration/secrets/
49-
*/
41+
/**
42+
* Environment Variables
43+
* https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
44+
*/
45+
// "vars": { "MY_VARIABLE": "production_value" },
46+
/**
47+
* Note: Use secrets to store sensitive data.
48+
* https://developers.cloudflare.com/workers/configuration/secrets/
49+
*/
5050

51-
/**
52-
* Static Assets
53-
* https://developers.cloudflare.com/workers/static-assets/binding/
54-
*/
55-
// "assets": { "directory": "./public/", "binding": "ASSETS" },
51+
/**
52+
* Static Assets
53+
* https://developers.cloudflare.com/workers/static-assets/binding/
54+
*/
55+
// "assets": { "directory": "./public/", "binding": "ASSETS" },
5656

57-
/**
58-
* Service Bindings (communicate between multiple Workers)
59-
* https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
60-
*/
61-
// "services": [{ "binding": "MY_SERVICE", "service": "my-service" }]
57+
/**
58+
* Service Bindings (communicate between multiple Workers)
59+
* https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
60+
*/
61+
// "services": [{ "binding": "MY_SERVICE", "service": "my-service" }]
6262
}

0 commit comments

Comments
 (0)