Skip to content

add camel severs folder #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import Image from "next/image";
import { useState } from "react";
import { anthropicServers, officialServers } from "@/public/servers";
import { anthropicServers, officialServers, camelServers } from "@/public/servers";
import {
Card,
CardDescription,
Expand All @@ -20,7 +20,8 @@ import { Header } from "@/components/header";

const serversWithSource = [
...anthropicServers.map(server => ({ ...server, source: 'anthropic' as const })),
...officialServers.map(server => ({ ...server, source: 'official' as const }))
...officialServers.map(server => ({ ...server, source: 'official' as const })),
...camelServers.map(server => ({ ...server, source: 'camel' as const }))
];

const allServers = serversWithSource.sort((a, b) =>
Expand All @@ -37,7 +38,7 @@ interface Server {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
env?: Record<string, any>;
homepage: string;
source?: 'anthropic' | 'official';
source?: 'anthropic' | 'official' | 'camel';
}

interface ModalProps {
Expand Down
8 changes: 4 additions & 4 deletions app/robots.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MetadataRoute } from 'next';

// 网站基础URL - 生产环境使用实际域名,开发环境使用localhost
// Base site URL - use actual domain in production, localhost in development
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL ||
process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` :
'https://mcp.camel-ai.org';
Expand All @@ -12,9 +12,9 @@ export default function robots(): MetadataRoute.Robots {
userAgent: '*',
allow: '/',
disallow: [
'/api/', // 禁止爬取API路径
'/_next/', // 禁止爬取Next.js内部路径
'/static/images/icons/', // 禁止爬取图标文件
'/api/', // Disallow crawling API paths
'/_next/', // Disallow crawling Next.js internal paths
'/static/images/icons/', // Disallow crawling icon files
],
},
],
Expand Down
29 changes: 18 additions & 11 deletions app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
import { MetadataRoute } from 'next';
import { anthropicServers, officialServers } from "@/public/servers";
import { anthropicServers, officialServers, camelServers } from "@/public/servers";

// 合并所有服务器数据
// Merge all server data
const serversWithSource = [
...anthropicServers.map(server => ({ ...server, source: 'anthropic' })),
...officialServers.map(server => ({ ...server, source: 'official' }))
...officialServers.map(server => ({ ...server, source: 'official' })),
...camelServers.map(server => ({ ...server, source: 'camel' }))
];

// 按名称排序
// Sort by name
const allServers = serversWithSource.sort((a, b) =>
a.name.localeCompare(b.name, undefined, { sensitivity: 'base' })
);

// 网站基础URL - 生产环境使用实际域名,开发环境使用localhost
// Base site URL - use actual domain in production, localhost in development
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL ||
process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` :
'https://mcp.camel-ai.org';

// 获取当前日期作为lastModified
// Get current date as lastModified
const currentDate = new Date();

// 生成sitemap
// Generate sitemap
export default function sitemap(): MetadataRoute.Sitemap {
// 创建基础页面的sitemap条目
// Create sitemap entries for base pages
const routes = [
{
url: baseUrl,
Expand All @@ -31,15 +32,15 @@ export default function sitemap(): MetadataRoute.Sitemap {
priority: 1.0,
},
{
// 添加服务器列表页
// Add server list page
url: `${baseUrl}/servers`,
lastModified: currentDate,
changeFrequency: 'weekly',
priority: 0.9,
},
] as MetadataRoute.Sitemap;

// 为每个服务器创建单独的sitemap条目
// Create individual sitemap entries for each server
allServers.forEach((server) => {
routes.push({
url: `${baseUrl}/servers/${server.key}`,
Expand All @@ -49,7 +50,7 @@ export default function sitemap(): MetadataRoute.Sitemap {
});
});

// 按来源分类的页面
// Pages categorized by source
routes.push(
{
url: `${baseUrl}/servers/source/official`,
Expand All @@ -62,6 +63,12 @@ export default function sitemap(): MetadataRoute.Sitemap {
lastModified: currentDate,
changeFrequency: 'weekly',
priority: 0.7,
},
{
url: `${baseUrl}/servers/source/camel`,
lastModified: currentDate,
changeFrequency: 'weekly',
priority: 0.7,
}
);

Expand Down
13 changes: 13 additions & 0 deletions public/servers/camel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"name": "camel-tool",
"key": "camel-tool",
"description": "add description here",
"command": "uvx",
"args": ["add args here"],
"env": {
"add env name here": "add env value here"
},
"homepage": "add homepage here"
}
]
3 changes: 2 additions & 1 deletion public/servers/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import anthropicServers from "./anthropics.json";
import officialServers from "./officials.json";
import camelServers from "./camel.json";

export { anthropicServers, officialServers };
export { anthropicServers, officialServers, camelServers };