Skip to content

Commit 21ab744

Browse files
committed
ESLint
1 parent b12683f commit 21ab744

File tree

7 files changed

+88
-31
lines changed

7 files changed

+88
-31
lines changed

modelcontextprotocol/lib/pd-client.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ export const createPdClient = () => {
99
const clientSecret = z.string().parse(config.pipedream.clientSecret)
1010
const projectId = z.string().parse(config.pipedream.projectId)
1111
const environment = z
12-
.enum(["development", "production"])
12+
.enum([
13+
"development",
14+
"production",
15+
])
1316
.parse(config.pipedream.environment)
1417

1518
return createBackendClient({
@@ -23,7 +26,9 @@ export const createPdClient = () => {
2326
} catch (error) {
2427
console.error(
2528
"Failed to create Pipedream client:",
26-
error instanceof Error ? error.message : "Unknown error"
29+
error instanceof Error
30+
? error.message
31+
: "Unknown error",
2732
)
2833
console.error("Make sure you've set all required environment variables:")
2934
console.error("- PIPEDREAM_CLIENT_ID (not shown for security)")

modelcontextprotocol/lib/registerComponentTools.ts

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"
2-
import { z, ZodRawShape } from "zod"
2+
import {
3+
z, ZodRawShape,
4+
} from "zod"
35
import { createPdClient } from "./pd-client.js"
46
import { RunActionOpts } from "@pipedream/sdk"
57
import { getAuthProvision } from "./authProvisions.js"
@@ -28,17 +30,23 @@ export async function registerComponentTools({
2830
name: string,
2931
description: string,
3032
schema: ZodRawShape,
31-
handler: any
33+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
34+
handler: any,
3235
): SafeRegisterToolResult => {
3336
try {
3437
server.tool(name, description, schema, handler)
35-
return { success: true }
38+
return {
39+
success: true,
40+
}
3641
} catch (error) {
3742
if (
3843
error instanceof Error &&
3944
error.message.includes("already registered")
4045
) {
41-
return { success: false, reason: "already_registered" }
46+
return {
47+
success: false,
48+
reason: "already_registered",
49+
}
4250
}
4351
throw error // Re-throw any other errors
4452
}
@@ -78,8 +86,10 @@ export async function registerComponentTools({
7886
z.string().transform((val) => {
7987
try {
8088
return JSON.parse(val)
81-
} catch (e) {
82-
return [val] // If not valid JSON, treat as single item array
89+
} catch {
90+
return [
91+
val,
92+
] // If not valid JSON, treat as single item array
8393
}
8494
}),
8595
z.array(z.string()),
@@ -123,10 +133,13 @@ export async function registerComponentTools({
123133
const description = `
124134
${component.description ?? "No description available"}
125135
126-
${configurablePropsDescription ? "\n\n\n\nIMPORTANT: The arguments have specific formats. Please follow the instructions below:\n" + configurablePropsDescription : ""}
136+
${configurablePropsDescription
137+
? "\n\n\n\nIMPORTANT: The arguments have specific formats. Please follow the instructions below:\n" + configurablePropsDescription
138+
: ""}
127139
`.trim()
128140

129141
// Register the tool for this component
142+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
130143
safeRegisterTool(component.key, description, schema, async (_args: any) => {
131144
const args = z.object(schema).parse(_args)
132145
const authProvisionResponse = await getAuthProvision({
@@ -162,7 +175,7 @@ ${configurablePropsDescription ? "\n\n\n\nIMPORTANT: The arguments have specific
162175
console.log(
163176
"Running action:",
164177
component.key,
165-
"for external user: [REDACTED]"
178+
"for external user: [REDACTED]",
166179
)
167180
const response = await pd.runAction(requestOpts)
168181

@@ -186,6 +199,7 @@ ${configurablePropsDescription ? "\n\n\n\nIMPORTANT: The arguments have specific
186199
CONFIGURE_COMPONENT_TOOL_NAME,
187200
configureComponentDescription,
188201
ConfigureComponentRawSchema,
202+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
189203
async (_args: any) => {
190204
const args = z.object(ConfigureComponentRawSchema).parse(_args)
191205
const authProvisionResponse = await getAuthProvision({
@@ -226,6 +240,6 @@ ${configurablePropsDescription ? "\n\n\n\nIMPORTANT: The arguments have specific
226240
},
227241
],
228242
}
229-
}
243+
},
230244
)
231245
}

modelcontextprotocol/package-lock.json

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

modelcontextprotocol/src/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { fileURLToPath } from "url"
99
const __filename = fileURLToPath(import.meta.url)
1010
const __dirname = path.dirname(__filename)
1111
const packageJson = JSON.parse(
12-
fs.readFileSync(path.join(__dirname, "../../package.json"), "utf8")
12+
fs.readFileSync(path.join(__dirname, "../../package.json"), "utf8"),
1313
)
1414
const version = packageJson.version
1515

@@ -26,7 +26,7 @@ program
2626
.requiredOption("--app <app>", "Specify the MCP app name")
2727
.option(
2828
"--external-user-id <id>",
29-
"Specify the external user ID (defaults to a random UUID)"
29+
"Specify the external user ID (defaults to a random UUID)",
3030
)
3131
.action(async (options) => {
3232
try {

0 commit comments

Comments
 (0)