anthropic-mcp-ai

No description

GitHub Stars

0

User Rating

Not Rated

Favorites

0

Views

32

Forks

0

Issues

0

README
๐Ÿง  Name Analyzer with AI

This project is a Proof of Concept (POC) for implementing the Model Context Protocol (MCP) to track the full lifecycle of an API request, enrich it with structured data, and use AI (GPT-4o / GPT-3.5) to generate an automatic technical summary.


๐Ÿš€ Features
  • ๐Ÿงพ Request lifecycle trace using the MCPContext abstraction
  • ๐ŸŒ External API integrations:
  • ๐Ÿง  AI-powered analysis using OpenAI's GPT models
  • ๐Ÿ“„ OpenAPI 3.0 documentation served via Swagger UI
  • ๐Ÿ“ฆ Clean architecture using Spring Boot 3 + Java 17

๐Ÿ“ Architecture
Client
  |
  v
/analyze [POST] <----> AnalyzeController
                         |
                         v
                  AnalyzerService
                         |
            +------------+------------+
            |                         |
        AgifyClient             GenderizeClient
            |                         |
            +------------+------------+
                         |
                      MCPContext  โ† records full trace
                         |
                         v
                     IAService  โ†’ OpenAI call
                         |
                         v
                  AnalyzeResponse (enriched)

๐Ÿ”ง Tech Stack
  • Java 17 โ˜•๏ธ
  • Spring Boot 3 โš™๏ธ
  • Spring WebFlux (WebClient) ๐ŸŒ
  • Lombok ๐Ÿงฌ
  • OpenAI API (Chat Completions โ€“ GPT-4o / GPT-3.5) ๐Ÿค–

๐Ÿ“ฅ How to Run
# Clone the repository
git clone https://github.com/your-username/anthropic-mcp-ai.git
cd anthropic-mcp-ai

# Make sure you have Java 17 installed
./mvnw spring-boot:run

๐Ÿ” Environment Configuration

Set these variables in your environment or in a .env file:

OPENAI_API_KEY=sk-XXXXXXXXXXXXXXXXXXXXXXXXXXX

These values will be loaded via the AIProperties class using @ConfigurationProperties.


๐Ÿงช Try It

Once the server is running, access:

{
  "name": "gabriel"
}

You will receive a structured response with the AI-generated explanation in the technicalExplanation field.


Enjoy! ๐Ÿ˜‰