Skip to content

achrafS133/mcp-spring-python-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCP-Spring-Python-AI: Multi-Protocol Chatbot

License: MIT
Spring Boot
Angular
Python
NodeJS

A Model Context Protocol (MCP)-based chatbot integrating Spring Boot (AI + Ollama), Python/NodeJS MCP servers, and an Angular frontend.

Author: ER-RAHOUTI ACHRAF


Table of Contents


Overview

A modular chatbot demonstrating MCP protocol implementation with:

  • Spring Boot (SSE-based MCP client/server)
  • Python/NodeJS (STDIO-mode MCP tools)
  • Angular frontend for interactive chat.

Key Features

  • Multi-Backend Integration:
    • Spring AI + Ollama (Qwen3 model)
    • Python/NodeJS MCP servers for tool execution.
  • Real-Time Communication: SSE for streaming responses.
  • Agent-Based UI: Angular frontend with thinking/reply distinction.
  • Tool Ecosystem: Stock lookup, file ops, employee info, etc.

Architecture

The project consists of four main components:

  • mcp-client/: Spring Boot MCP Client

    • Implements AI agents and REST controllers.
    • Connects to MCP servers and manages AI interactions.
  • mcp-server/: Spring Boot MCP Server

    • Provides MCP tools and services.
    • Implements backend logic for tool execution.
  • mcp-frontend/: Angular Frontend

    • Interactive chat UI with agent thinking and reply views.
    • Built with Angular CLI.
  • python-mcp-server/: Python MCP Server

    • Additional MCP tools implemented in Python.
    • Provides extended functionality via MCP protocol.
  • Screenshots/: Directory containing project screenshots for reference.
    gi


Installation

Prerequisites

  • Ollama (ollama pull qwen3)
  • Node.js 18+
  • Angular CLI (npm install -g @angular/cli)
  • Postman (for API testing)
  • Java 17+ and Maven (for Spring Boot projects)

Steps

  1. Clone the repository and navigate to the project directory:
    git clone https://github.com/your-username/mcp-spring-python-ai.git  
    cd mcp-spring-python-ai  
  2. Build and run the Spring Boot client and server:
    cd mcp-client
    ./mvnw clean install
    ./mvnw spring-boot:run
    In a separate terminal:
    cd mcp-server
    ./mvnw clean install
    ./mvnw spring-boot:run
  3. Install and run the Angular frontend:
    cd mcp-frontend
    npm install
    ng serve
    Open your browser at http://localhost:4200/.
  4. Run the Python MCP server (optional):
    cd python-mcp-server
    python main.py

Usage

  • Use the Angular frontend to interact with the chatbot.
  • The Spring Boot client communicates with MCP servers for AI and tool execution.
  • The Python MCP server provides additional tools accessible via MCP protocol.

Technologies

  • Java 17+, Spring Boot 3.x
  • Angular 20.x
  • Python 3.x
  • Node.js 18+
  • Ollama Qwen3 AI model
  • Model Context Protocol (MCP)

Configuration

  • Configure MCP servers in mcp-client/src/main/resources/mcp-servers.json.
  • Application properties are in src/main/resources/application.properties for client and server.
  • Adjust Angular environment and configuration files as needed.

Testing & Debugging

  • Run unit tests for Spring Boot projects:
    ./mvnw test
  • Run Angular unit tests:
    ng test
  • Use Postman or similar tools for API testing.

Screenshots

See the Screenshots/ directory for visual references of the application in action.


License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published