Skip to content

Commit ca3b1e8

Browse files
committed
format
1 parent 99a4a43 commit ca3b1e8

17 files changed

+627
-628
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: "[BUG]"
4+
title: '[BUG]'
55
labels: bug
6-
assignees: ""
6+
assignees: ''
77
---
88

99
## Bug Description

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4-
title: "[FEATURE] "
4+
title: '[FEATURE] '
55
labels: enhancement
6-
assignees: ""
6+
assignees: ''
77
---
88

99
## Problem Statement

.prettierrc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"plugins": ["@ianvs/prettier-plugin-sort-imports"],
3-
"importOrder": ["<THIRD_PARTY_MODULES>", "^@/(.*)$", "^[./]"],
4-
"importOrderParserPlugins": ["typescript", "jsx", "decorators-legacy"],
5-
"semi": true,
6-
"singleQuote": true,
7-
"trailingComma": "all"
8-
}
2+
"plugins": ["@ianvs/prettier-plugin-sort-imports"],
3+
"importOrder": ["<THIRD_PARTY_MODULES>", "^@/(.*)$", "^[./]"],
4+
"importOrderParserPlugins": ["typescript", "jsx", "decorators-legacy"],
5+
"semi": true,
6+
"singleQuote": true,
7+
"trailingComma": "all"
8+
}

scripts/submit-to-directory.js

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010
* node submit-to-directory.js
1111
*/
1212

13-
const fs = require("node:fs");
14-
const path = require("node:path");
15-
const { execSync } = require("node:child_process");
16-
const readline = require("node:readline");
13+
const fs = require('node:fs');
14+
const path = require('node:path');
15+
const { execSync } = require('node:child_process');
16+
const readline = require('node:readline');
1717

1818
const rl = readline.createInterface({
1919
input: process.stdin,
2020
output: process.stdout,
2121
});
2222

2323
// Get package info
24-
const packageJson = JSON.parse(fs.readFileSync("package.json", "utf8"));
24+
const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8'));
2525

2626
console.log(`
2727
=================================================
@@ -39,34 +39,34 @@ Before proceeding, make sure:
3939
4040
`);
4141

42-
rl.question("Do you want to proceed? (y/n): ", (answer) => {
43-
if (answer.toLowerCase() !== "y") {
44-
console.log("Submission cancelled.");
42+
rl.question('Do you want to proceed? (y/n): ', (answer) => {
43+
if (answer.toLowerCase() !== 'y') {
44+
console.log('Submission cancelled.');
4545
rl.close();
4646
return;
4747
}
4848

49-
console.log("\nPreparing submission...\n");
49+
console.log('\nPreparing submission...\n');
5050

5151
// Check if package is published to npm
5252
try {
5353
const npmInfo = execSync(`npm view ${packageJson.name} --json`, {
54-
stdio: ["pipe", "pipe", "pipe"],
54+
stdio: ['pipe', 'pipe', 'pipe'],
5555
});
56-
console.log("✅ Package found on npm registry");
56+
console.log('✅ Package found on npm registry');
5757
} catch (error) {
5858
console.error(
59-
"❌ Package not found on npm registry. Please publish your package first:",
59+
'❌ Package not found on npm registry. Please publish your package first:',
6060
);
61-
console.error(" npm login");
62-
console.error(" npm publish");
61+
console.error(' npm login');
62+
console.error(' npm publish');
6363
rl.close();
6464
return;
6565
}
6666

6767
// Check if GitHub repository exists
6868
if (!packageJson.repository || !packageJson.repository.url) {
69-
console.error("❌ No GitHub repository URL found in package.json");
69+
console.error('❌ No GitHub repository URL found in package.json');
7070
console.error(' Please add a "repository" field to your package.json');
7171
rl.close();
7272
return;
@@ -78,38 +78,38 @@ rl.question("Do you want to proceed? (y/n): ", (answer) => {
7878
// Prepare submission data
7979
const submissionData = {
8080
name: packageJson.name,
81-
description: packageJson.description || "",
81+
description: packageJson.description || '',
8282
version: packageJson.version,
8383
repository: repoUrl,
84-
author: packageJson.author || "",
85-
license: packageJson.license || "",
84+
author: packageJson.author || '',
85+
license: packageJson.license || '',
8686
keywords: packageJson.keywords || [],
8787
tools: [
88-
"get-address",
89-
"get-testnet-eth",
90-
"list-balances",
91-
"transfer-funds",
92-
"deploy-contract",
88+
'get-address',
89+
'get-testnet-eth',
90+
'list-balances',
91+
'transfer-funds',
92+
'deploy-contract',
9393
],
9494
};
9595

9696
// Save submission data to a file
9797
const submissionFile = path.join(
9898
process.cwd(),
99-
"mcp-directory-submission.json",
99+
'mcp-directory-submission.json',
100100
);
101101
fs.writeFileSync(submissionFile, JSON.stringify(submissionData, null, 2));
102102

103103
console.log(`\n✅ Submission data saved to ${submissionFile}`);
104-
console.log("\nNext steps:");
104+
console.log('\nNext steps:');
105105
console.log(
106-
"1. Fork the MCP Directory repository: https://github.com/modelcontextprotocol/directory",
106+
'1. Fork the MCP Directory repository: https://github.com/modelcontextprotocol/directory',
107107
);
108108
console.log(
109-
"2. Add your MCP server to the directory using the data in mcp-directory-submission.json",
109+
'2. Add your MCP server to the directory using the data in mcp-directory-submission.json',
110110
);
111-
console.log("3. Submit a pull request to the MCP Directory repository");
112-
console.log("\nThank you for contributing to the MCP ecosystem!");
111+
console.log('3. Submit a pull request to the MCP Directory repository');
112+
console.log('\nThank you for contributing to the MCP ecosystem!');
113113

114114
rl.close();
115115
});

scripts/test-mcp.js

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,33 @@
1010
* node test-mcp.js
1111
*/
1212

13-
const { spawn } = require("node:child_process");
14-
const path = require("node:path");
15-
const fs = require("node:fs");
16-
require("dotenv").config();
13+
const { spawn } = require('node:child_process');
14+
const path = require('node:path');
15+
const fs = require('node:fs');
16+
require('dotenv').config();
1717

1818
// Check if required environment variables are set
1919
const requiredEnvVars = [
20-
"COINBASE_API_KEY_NAME",
21-
"COINBASE_API_PRIVATE_KEY",
22-
"SEED_PHRASE",
20+
'COINBASE_API_KEY_NAME',
21+
'COINBASE_API_PRIVATE_KEY',
22+
'SEED_PHRASE',
2323
];
2424

2525
const missingEnvVars = requiredEnvVars.filter(
2626
(varName) => !process.env[varName],
2727
);
2828
if (missingEnvVars.length > 0) {
2929
console.error(
30-
`Error: Missing required environment variables: ${missingEnvVars.join(", ")}`,
30+
`Error: Missing required environment variables: ${missingEnvVars.join(', ')}`,
3131
);
3232
console.error(
33-
"Please make sure these variables are set in your .env file or environment.",
33+
'Please make sure these variables are set in your .env file or environment.',
3434
);
3535
process.exit(1);
3636
}
3737

3838
// Path to the built MCP server
39-
const serverPath = path.join(__dirname, "build", "index.js");
39+
const serverPath = path.join(__dirname, 'build', 'index.js');
4040

4141
// Check if the server file exists
4242
if (!fs.existsSync(serverPath)) {
@@ -47,60 +47,60 @@ if (!fs.existsSync(serverPath)) {
4747
process.exit(1);
4848
}
4949

50-
console.log("Starting Base MCP server test...");
50+
console.log('Starting Base MCP server test...');
5151

5252
// Start the MCP server
53-
const server = spawn("node", [serverPath], {
54-
stdio: ["pipe", "pipe", "pipe"],
53+
const server = spawn('node', [serverPath], {
54+
stdio: ['pipe', 'pipe', 'pipe'],
5555
env: process.env,
5656
});
5757

5858
// Handle server output
59-
server.stderr.on("data", (data) => {
59+
server.stderr.on('data', (data) => {
6060
console.log(`[Server Log] ${data.toString().trim()}`);
6161
});
6262

6363
// Wait for server to start
6464
setTimeout(() => {
65-
console.log("\nSending test request to get wallet address...");
65+
console.log('\nSending test request to get wallet address...');
6666

6767
// Send a request to get the wallet address
6868
const request = {
69-
jsonrpc: "2.0",
69+
jsonrpc: '2.0',
7070
id: 1,
71-
method: "listTools",
71+
method: 'listTools',
7272
params: {},
7373
};
7474

7575
server.stdin.write(`${JSON.stringify(request)}\n`);
7676

7777
// Listen for response
78-
server.stdout.on("data", (data) => {
78+
server.stdout.on('data', (data) => {
7979
try {
8080
const response = JSON.parse(data.toString().trim());
81-
console.log("\nServer response:");
81+
console.log('\nServer response:');
8282
console.log(JSON.stringify(response, null, 2));
8383

8484
if (response.result?.tools) {
8585
console.log(
86-
"\n✅ Test successful! The Base MCP server is working correctly.",
86+
'\n✅ Test successful! The Base MCP server is working correctly.',
8787
);
88-
console.log("Available tools:");
88+
console.log('Available tools:');
8989
for (const tool of response.result.tools) {
9090
console.log(`- ${tool.name}: ${tool.description}`);
9191
}
9292
} else {
93-
console.log("\n❌ Test failed. Unexpected response from server.");
93+
console.log('\n❌ Test failed. Unexpected response from server.');
9494
}
9595

9696
// Now try to get the wallet address
97-
console.log("\nTesting get-address tool...");
97+
console.log('\nTesting get-address tool...');
9898
const addressRequest = {
99-
jsonrpc: "2.0",
99+
jsonrpc: '2.0',
100100
id: 2,
101-
method: "callTool",
101+
method: 'callTool',
102102
params: {
103-
name: "get-address",
103+
name: 'get-address',
104104
arguments: {},
105105
},
106106
};
@@ -109,26 +109,26 @@ setTimeout(() => {
109109

110110
// We'll handle this response in the next data event
111111
} catch (error) {
112-
console.error("Error parsing server response:", error);
112+
console.error('Error parsing server response:', error);
113113
}
114114
});
115115

116116
// Set a timeout to terminate the test
117117
setTimeout(() => {
118-
console.log("\nTest complete. Terminating server.");
118+
console.log('\nTest complete. Terminating server.');
119119
server.kill();
120120
process.exit(0);
121121
}, 5000);
122122
}, 2000);
123123

124124
// Handle server errors
125-
server.on("error", (error) => {
126-
console.error("Server error:", error);
125+
server.on('error', (error) => {
126+
console.error('Server error:', error);
127127
process.exit(1);
128128
});
129129

130130
// Handle server exit
131-
server.on("close", (code) => {
131+
server.on('close', (code) => {
132132
if (code !== 0 && code !== null) {
133133
console.error(`Server exited with code ${code}`);
134134
process.exit(1);

0 commit comments

Comments
 (0)