English | 中文
A Model Context Protocol (MCP) server that provides intelligent access and management functionality for the public-apis database.
Public APIs MCP Server is a professional MCP server implementation designed to provide developers with convenient public API discovery, search, and integration services. Through the standardized MCP protocol, you can easily integrate rich public API resources into various AI assistants and development tools.
- 🔍 Smart Search: Multi-dimensional API search by category, keywords, authentication method, etc.
- 🛡️ Security Filtering: Security filtering including HTTPS support, CORS configuration, etc.
- 🎯 Smart Recommendations: Intelligently recommend the most suitable APIs based on project requirements
- 💻 Code Generation: Automatically generate API integration code in multiple programming languages
- 📊 Statistical Analysis: Provide detailed API data statistics and analysis
- 🔄 Real-time Sync: Support synchronizing the latest API data from GitHub repositories
- Node.js >= 18.0.0
- npm >= 8.0.0
# Clone the project
git clone https://github.com/worryzyy/public-apis-mcp.git
cd public-apis-mcp
# Install dependencies
npm install
# Build the project
npm run build
# Start the server
npm start
# Start in development mode (with hot reload)
npm run dev
After the server starts, it will communicate with MCP clients through standard input/output. You can configure this server in AI assistants or development tools that support the MCP protocol.
{
"mcpServers": {
"public-apis-mcp": {
"command": "node",
"args": ["path/to/public-apis-mcp/dist/index.js"]
}
}
}
Or
{
"mcpServers": {
"public-apis-mcp": {
"command": "npx",
"args": ["-y", "@weilei_kyle/public-apis-mcp"]
}
}
}
Search APIs by category
Parameters:
category
(string, required): API category namelimit
(number, optional): Limit the number of results returned, default 10
Example:
{
"category": "Weather",
"limit": 5
}
Search APIs by keyword
Parameters:
keyword
(string, required): Search keywordlimit
(number, optional): Limit the number of results returned, default 10
Filter APIs by authentication requirements
Parameters:
authType
(string, required): Authentication type (No
,apiKey
,OAuth
,X-Mashape-Key
,User-Agent
)limit
(number, optional): Limit the number of results returned, default 10
Filter APIs that support HTTPS
Parameters:
httpsOnly
(boolean, optional): Whether to return only APIs that support HTTPS, default truelimit
(number, optional): Limit the number of results returned, default 10
Filter APIs that support cross-origin access
Parameters:
corsSupport
(string, required): CORS support status (yes
,no
,unknown
)limit
(number, optional): Limit the number of results returned, default 10
Get detailed information for a specific API
Parameters:
apiName
(string, required): API name
Get a list of all available API categories
Randomly recommend an API
Parameters:
category
(string, optional): Limit random selection within a specific category
Get API quantity statistics
Analyze the distribution of APIs by different authentication methods
Recommend suitable APIs based on project requirements
Parameters:
projectType
(string, required): Project type descriptionrequirements
(array, optional): List of project requirementslimit
(number, optional): Limit the number of recommended APIs, default 5
Find alternative API options
Parameters:
functionality
(string, required): Required functionality descriptionlimit
(number, optional): Limit the number of results returned, default 5
Generate integration code examples for selected APIs
Parameters:
apiName
(string, required): API namelanguage
(string, optional): Programming language (javascript
,python
,curl
), default javascript
Synchronize the latest API list from GitHub repository
Important Note: This interface currently uses a manual synchronization mechanism to sync the latest data from the public-apis repository to the local server. This mainly ensures data stability and access speed.
How it works:
- Manually trigger fetching the latest API data from the GitHub repository
- Cache data to the local server to improve query performance
- Support both incremental updates and forced full synchronization modes
- Return detailed synchronization status reports after completion
Parameters:
force
(boolean, optional): Whether to force re-synchronization, default falsefalse
: Only perform incremental synchronization when data is expiredtrue
: Force full data synchronization, ignoring local cache
Usage Recommendations:
- It's recommended to perform a forced synchronization (
force: true
) before first use - Periodically perform incremental synchronization during daily use to get the latest data
- Use forced synchronization to reset local cache if data anomalies are found
Check recently added new APIs
Parameters:
days
(number, optional): Check new APIs added in recent days, default 7 days
public-apis-mcp/
├── src/
│ ├── index.ts # Main entry file
│ ├── server/
│ │ └── server.ts # MCP server implementation
│ ├── services/
│ │ ├── api-service.ts # API data management service
│ │ ├── search-service.ts # Search functionality service
│ │ ├── tool-service.ts # Tool call handling service
│ │ ├── code-generation-service.ts # Code generation service
│ │ ├── recommendation-service.ts # Recommendation algorithm service
│ │ └── formatter-service.ts # Data formatting service
│ └── types/
│ └── api.ts # TypeScript type definitions
├── dist/ # Compilation output directory
├── package.json # Project configuration
├── tsconfig.json # TypeScript configuration
└── README.md # Project documentation
- TypeScript: Type-safe JavaScript superset
- Node.js: JavaScript runtime environment
- MCP SDK: Model Context Protocol software development kit
- Axios: HTTP client library
- Zod: TypeScript-first schema validation library
# Compile TypeScript
npm run build
# Run tests
npm test
# Development mode (hot reload)
npm run dev
The project follows these development standards:
- Use TypeScript for type-safe development
- Adopt modular architecture design
- Comprehensive error handling mechanisms
- Detailed code comments and documentation
Welcome to submit Issues and Pull Requests to improve this project!
- Fork this repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- public-apis - Providing rich public API data sources
If you have questions or suggestions, please contact us through:
- Submit a GitHub Issue
Note: This project is still under active development, and APIs may change. It is recommended to test carefully before using in production environments.