Skip to main content
Glama

MCP API Server

by fikri2992
requirements.md5.03 kB
# Requirements Document ## Introduction Transform the existing MCP API server project into an MCP Builder CLI tool that can automatically generate MCP server code from API specifications. The tool will read API definitions from markdown files (containing curl commands), generate appropriate MCP server code, and use AI SDK with OpenAI to parse and adjust the generated code for optimal functionality. ## Requirements ### Requirement 1 **User Story:** As a developer, I want to provide API specifications in a markdown file format, so that I can automatically generate MCP server code without manual implementation. #### Acceptance Criteria 1. WHEN a user provides an api.md file with curl commands THEN the system SHALL parse the markdown file and extract API endpoint information 2. WHEN the system parses curl commands THEN it SHALL identify HTTP methods, URLs, headers, and request bodies 3. WHEN API specifications are parsed THEN the system SHALL validate the extracted information for completeness 4. IF the markdown file contains invalid or incomplete API specifications THEN the system SHALL provide clear error messages indicating what needs to be fixed ### Requirement 2 **User Story:** As a developer, I want to use a CLI interface to generate MCP servers, so that I can easily integrate the tool into my development workflow. #### Acceptance Criteria 1. WHEN a user runs the CLI command THEN the system SHALL provide a help menu with available options 2. WHEN a user specifies an input markdown file THEN the system SHALL read and process the file 3. WHEN a user specifies an output directory THEN the system SHALL generate the MCP server code in that location 4. WHEN the CLI is executed THEN it SHALL provide progress feedback and status updates 5. IF the CLI encounters errors THEN it SHALL display helpful error messages and exit gracefully ### Requirement 3 **User Story:** As a developer, I want the generated MCP server to include proper tool definitions, so that MCP clients can discover and use the API endpoints. #### Acceptance Criteria 1. WHEN API endpoints are processed THEN the system SHALL generate corresponding MCP tool definitions 2. WHEN generating tool definitions THEN each tool SHALL have appropriate parameter schemas based on the API specification 3. WHEN generating tool definitions THEN each tool SHALL include proper descriptions and metadata 4. WHEN multiple endpoints exist THEN the system SHALL create separate tools for each unique endpoint and method combination ### Requirement 4 **User Story:** As a developer, I want AI-powered code optimization, so that the generated MCP server code follows best practices and handles edge cases properly. #### Acceptance Criteria 1. WHEN MCP server code is generated THEN the system SHALL use AI SDK with OpenAI to review and optimize the code 2. WHEN AI optimization occurs THEN it SHALL improve error handling, validation, and code structure 3. WHEN AI processes the code THEN it SHALL ensure compatibility with MCP protocol standards 4. WHEN AI optimization is complete THEN the system SHALL provide a summary of improvements made ### Requirement 5 **User Story:** As a developer, I want the generated MCP server to include proper request validation and error handling, so that it operates reliably in production environments. #### Acceptance Criteria 1. WHEN API requests are made through the generated MCP server THEN it SHALL validate all required parameters 2. WHEN validation fails THEN the system SHALL return clear error messages to the MCP client 3. WHEN HTTP requests fail THEN the system SHALL handle errors gracefully and provide meaningful feedback 4. WHEN the MCP server starts THEN it SHALL validate its configuration and report any issues ### Requirement 6 **User Story:** As a developer, I want to customize the generated MCP server configuration, so that I can adapt it to different deployment environments. #### Acceptance Criteria 1. WHEN generating the MCP server THEN the system SHALL create configurable options for timeouts, security settings, and logging 2. WHEN configuration options are provided THEN they SHALL be documented in the generated README 3. WHEN the MCP server runs THEN it SHALL respect environment variables and CLI arguments for configuration 4. IF custom configuration is needed THEN the generated code SHALL be easily modifiable ### Requirement 7 **User Story:** As a developer, I want the generated MCP server to include comprehensive documentation, so that other developers can understand and maintain the code. #### Acceptance Criteria 1. WHEN MCP server code is generated THEN it SHALL include inline comments explaining key functionality 2. WHEN the generation is complete THEN the system SHALL create a README file with usage instructions 3. WHEN documentation is generated THEN it SHALL include examples of how to use each generated tool 4. WHEN the MCP server is generated THEN it SHALL include TypeScript type definitions for better development experience

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fikri2992/mcp0'

If you have feedback or need assistance with the MCP directory API, please join our Discord server