Skip to content

Commit 77003a9

Browse files
committed
docs: clean comments
1 parent 2f35b49 commit 77003a9

File tree

3 files changed

+2
-18
lines changed

3 files changed

+2
-18
lines changed

.github/scripts/validate-server-json.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const fs = require('fs');
22
const path = require('path');
33

4-
// 定义所有服务器JSON文件必须包含的字段
54
const requiredFields = ['name', 'key', 'description', 'command', 'homepage'];
65

76
function validateJsonFile(filePath, requiredFieldsList) {
@@ -57,17 +56,14 @@ function validateJsonFile(filePath, requiredFieldsList) {
5756
}
5857
}
5958

60-
// 验证 public/servers/ 目录下的所有JSON文件
6159
const rootDir = process.cwd();
6260
const serversDir = path.join(rootDir, 'public', 'servers');
6361

64-
// 检查目录是否存在
6562
if (!fs.existsSync(serversDir)) {
6663
console.error(`Error: Directory ${serversDir} does not exist`);
6764
process.exit(1);
6865
}
6966

70-
// 获取目录中的所有JSON文件
7167
let jsonFiles = [];
7268

7369
function findJsonFiles(dir) {
@@ -78,24 +74,20 @@ function findJsonFiles(dir) {
7874
const stat = fs.statSync(filePath);
7975

8076
if (stat.isDirectory()) {
81-
// 递归遍历子目录
8277
findJsonFiles(filePath);
8378
} else if (file.endsWith('.json')) {
84-
// 添加JSON文件到列表
8579
jsonFiles.push(filePath);
8680
}
8781
});
8882
}
8983

90-
// 开始搜索JSON文件
9184
findJsonFiles(serversDir);
9285

9386
if (jsonFiles.length === 0) {
9487
console.warn(`Warning: No JSON files found in ${serversDir}`);
9588
process.exit(0);
9689
}
9790

98-
// 验证每个JSON文件
9991
let hasErrors = false;
10092

10193
jsonFiles.forEach(jsonFile => {

app/metadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const homeMetadata: Metadata = {
88
description: "Explore CamelAI's MCP Hub: your directory of official MCP (Model Context Protocol) servers and integrations designed to supercharge AI agents and multi-agent workflows.",
99
images: [
1010
{
11-
url: "/og-image.jpg", // Make sure to add this image to your public folder
11+
url: "/og-image.jpg",
1212
width: 1200,
1313
height: 630,
1414
alt: "CamelAI MCP Hub - Official MCP Servers & Integrations",

app/page.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ import { Check, Copy, ShieldCheck, Grid2X2 } from "lucide-react";
1818
import { motion, AnimatePresence } from "framer-motion";
1919
import { Header } from "@/components/header";
2020

21-
// 给每个服务器添加来源标记
2221
const serversWithSource = [
2322
...anthropicServers.map(server => ({ ...server, source: 'anthropic' as const })),
2423
...officialServers.map(server => ({ ...server, source: 'official' as const }))
2524
];
2625

27-
// 按名称字母顺序排序
2826
const allServers = serversWithSource.sort((a, b) =>
2927
a.name.localeCompare(b.name, undefined, { sensitivity: 'base' })
3028
);
@@ -48,32 +46,27 @@ interface ModalProps {
4846
}
4947

5048
function Modal({ server, onClose }: ModalProps) {
51-
// Create a config object that matches Claude client format
5249
const serverConfig = {
5350
command: server.command,
5451
...(server.args && { args: server.args }),
5552
...(server.env && { env: server.env })
5653
};
5754

58-
// Create the final config object using the server's key as property name
5955
const configObject = {
6056
mcpServers: {
6157
[server.key.toLowerCase()]: serverConfig
6258
}
6359
};
6460

65-
// Convert the config object to a formatted JSON string
6661
const formattedConfig = JSON.stringify(configObject, null, 2);
6762

68-
// State to track if config has been copied
6963
const [copied, setCopied] = useState(false);
7064

71-
// Function to copy config to clipboard
7265
const copyToClipboard = () => {
7366
navigator.clipboard.writeText(formattedConfig)
7467
.then(() => {
7568
setCopied(true);
76-
setTimeout(() => setCopied(false), 2000); // Reset after 2 seconds
69+
setTimeout(() => setCopied(false), 2000)
7770
})
7871
.catch(err => {
7972
console.error('Copy failed:', err);
@@ -174,7 +167,6 @@ export default function Home() {
174167
setIsModalOpen(false);
175168
};
176169

177-
// 根据筛选条件过滤服务器列表
178170
const filteredServers = allServers.filter(server => {
179171
if (filter === 'all') return true;
180172
return server.source === filter;

0 commit comments

Comments
 (0)