logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

mcp-ai-api-assistant

An intelligent Model Context Protocol (MCP) endpoint utilizing the Claude AI model to facilitate sophisticated API interaction drafting and contextual documentation retrieval. It offers functionalities for translating natural language specifications into executable query formats and sourcing precise documentation details based on user inquiries.

Author

mcp-ai-api-assistant logo

crazyrabbitLTC

No License

Quick Info

GitHub GitHub Stars 3
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

apisapidocumentationapi documentationquery generationanalyzing api

MCP AI API Interface Agent

This server instance operates under the Model Context Protocol, leveraging the advanced capabilities of Claude AI to provide sophisticated assistance for API operations. It critically examines provided API specifications to power two primary utilities:

  • synthesize-call: Converts human-readable requirements into structured API invocation syntax.
  • lookup-spec: Retrieves pertinent details from the ingested documentation corpus in response to direct questions.

System Requirements

  • Node.js environment, version 18 or newer is mandatory.
  • A valid API credential for the Anthropic service (Claude).

Initial Setup Procedure

  1. Obtain the source code repository via cloning.
  2. Install required software packages: bash npm install

  3. Establish a configuration file named .env containing your Anthropic access token:

ANTHROPIC_API_KEY=your_secret_token_here

Configuration Steps

Prior to server activation, execute the following compilation and initialization sequence: bash npm run build npm run setup

This sequence achieves several goals: - Establishes necessary folder structures (docs/ for specifications, prompts/ for instructional texts). - Populates starter prompt templates. - Generates an initial synopsis of the service capabilities.

Subsequent actions include:

  1. Deposit all relevant API documentation assets (supporting formats: .txt, .md, and .json) into the designated docs/ directory.

  2. Optional refinement of internal instructions found within the prompts/ subdirectory:

  3. system-prompt.txt: The core directive guiding Claude's overall behavior.
  4. tool-metadata.txt: Supplementary context specifically detailing tool functionality.
  5. query-metadata.txt: Specific guidance for the query synthesis operation.
  6. service-description.txt: The automatically generated overview of service functionality.

Operational Guide

Direct Server Execution

Initiate the service runtime: bash npm start

The service exposes two distinct endpoint functions via the MCP framework:

  • synthesize-call: Formulates an API interaction based on a plain-language directive

{ "name": "synthesize-call", "arguments": { "request": "Retrieve the complete record set for accounts established within the preceding seven days" } }

  • lookup-spec: Queries the documentation repository for targeted information

{ "name": "lookup-spec", "arguments": { "request": "What is the required procedure for securely authorizing subsequent API transmissions?" } }

Integration with Claude Desktop Application

Incorporate the following configuration stanza into your Claude Desktop settings file:

{ "mcpServers": { "ai-api-tool": { "command": "node", "args": ["/COMPLETE/ABSOLUTE/PATH/TO/mcp-ai-api-assistant/build/index.js"], "env": { "ANTHROPIC_API_KEY": "your_secret_token_here" } } } }

  1. Substitute /COMPLETE/ABSOLUTE/PATH/TO/mcp-ai-api-assistant with the actual physical location of your server installation.

  2. Reinitialize the Claude Desktop application.

Internal Layout

. ├── docs/ # API Specification Artifacts ├── prompts/ # Instructional Templates & Context Files │ ├── system-prompt.txt # Primary directive for the AI agent │ ├── tool-metadata.txt # Contextual data for tool definitions │ ├── query-metadata.txt # Contextual data for request formulation │ └── service-description.txt # Dynamically created service summary ├── src/ # Source Code Modules │ ├── index.ts # Primary execution initiator │ ├── server.ts # MCP Listener Implementation │ └── services/ # Core Business Logic │ └── expertService.ts # Interface layer for Claude interactions └── package.json

Development Cycle

  • To compile the source code: bash npm run build

  • The runtime environment is constructed with TypeScript and adheres to a layered, modular design philosophy.

  • All interactions involving the Claude service are encapsulated within the ExpertService abstraction.
  • Diagnostic messages are routed to standard error (stderr) and prefixed with the tag [DEBUG].

Debugging Common Issues

Should communication failures occur, systematically review the following:

  1. Confirmation that the initialization script was executed successfully: bash npm run setup

  2. Validation that all necessary files reside within the prompts/ directory.

  3. Verification of the correct assignment and accessibility of the ANTHROPIC_API_KEY environment variable.
  4. Use of fully qualified, absolute directory references within the Claude Desktop configuration.
  5. Scrutiny of the diagnostic output stream (stderr) for error markers.

Essential Environmental Variables

  • ANTHROPIC_API_KEY: Authentication credential for the Anthropic platform (Mandatory)

Licensing

This project is distributed under the MIT License.

See Also

`