GIM-MCP

GIM-MCP

An educational interaction management system that uses MCP and Ollama to create and manage flashcards and other learning content. It enables dynamic content generation and transformation through natural language processing using local AI models.

Category
Visit Server

README

GIM-MCP

Educational interaction management system based on Model Context Protocol (MCP) with Ollama integration for conversational AI capabilities.

πŸ“‹ Description

GIM-MCP is an MCP server that provides a RESTful API to manage educational interactions (such as flashcards) with artificial intelligence support. The system uses Ollama for natural language processing and allows for dynamic creation, management, and generation of educational content.

🎯 Features

  • MCP Server: Complete Model Context Protocol implementation to expose resources and tools
  • REST API: HTTP endpoint to interact with the system via chat
  • Ollama Integration: Natural language processing using local models
  • Dynamic Interactions: Extensible system to define different types of educational interactions
  • Flashcard Support: Complete flashcard implementation with text, images, and categories
  • Zod Validation: Robust validation schemas for editor and renderer

πŸ“¦ Prerequisites

Required Software

  1. Node.js (v18 or higher)

    • Download from: https://nodejs.org/
  2. Ollama (Required for AI functionality)

    • Windows: Download from https://ollama.com/download
    • Linux/Mac:
      curl -fsSL https://ollama.com/install.sh | sh
      
  3. Git (to clone the repository)

Ollama Setup

After installing Ollama, download the required model:

ollama pull llama3.1

Verify that Ollama is running:

ollama list

The Ollama server should be available at http://localhost:11434

πŸš€ Installation

  1. Clone the repository

    git clone <repository-url>
    cd gim-mcp
    
  2. Install dependencies

    npm install
    
  3. Verify TypeScript configuration

    npm run build
    

πŸ’» Usage

Development Mode

Start the server in development mode with hot-reload:

npm run dev

The server will be available at http://localhost:3000

Production Mode

  1. Build the project

    npm run build
    
  2. Start the compiled server

    npm start
    

Testing the API

You can test the chat endpoint with a POST request:

curl -X POST http://localhost:3000/api/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "Create a flashcard about mathematics"}'

Or using PowerShell:

Invoke-RestMethod -Uri "http://localhost:3000/api/chat" `
  -Method POST `
  -ContentType "application/json" `
  -Body '{"message": "Create a flashcard about mathematics"}'

πŸ“ Project Structure

gim-mcp/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ api.ts                          # Express REST API
β”‚   β”œβ”€β”€ server.ts                       # Main MCP server
β”‚   β”œβ”€β”€ orchestrator.ts                 # Orchestration logic with Ollama
β”‚   β”œβ”€β”€ mcp-client-local.ts            # Local MCP client
β”‚   β”œβ”€β”€ mcp/
β”‚   β”‚   └── mcp-tool.types.ts          # MCP tool types
β”‚   β”œβ”€β”€ prompts/
β”‚   β”‚   └── instrucciones-gim.ts       # System prompts
β”‚   β”œβ”€β”€ resources/
β”‚   β”‚   β”œβ”€β”€ index.ts                    # Resource exports
β”‚   β”‚   β”œβ”€β”€ interaction-base-types.ts   # Base types
β”‚   β”‚   β”œβ”€β”€ mcp-resource.types.ts       # MCP resource types
β”‚   β”‚   β”œβ”€β”€ flashcard/                  # Flashcard implementation
β”‚   β”‚   β”‚   β”œβ”€β”€ flashcard.editor.schema.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ flashcard.renderer.schema.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ flashcard.resource.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ flashcard.transform.spec.ts
β”‚   β”‚   β”‚   └── index.ts
β”‚   β”‚   └── interactions-index/
β”‚   β”‚       └── interactions-index.resource.ts
β”‚   β”œβ”€β”€ types/                          # Additional TypeScript types
β”‚   └── utils/                          # Utilities
β”œβ”€β”€ dist/                               # Compiled files
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── README.md

πŸ”§ Configuration

Environment Variables (Optional)

You can create a .env file to customize the configuration:

# API server port
PORT=3000

# Ollama URL
OLLAMA_URL=http://localhost:11434

# Ollama model to use
OLLAMA_MODEL=llama3.1

Changing the Ollama Model

Edit the src/orchestrator.ts file:

const MODEL = "llama3.1"; // Change to your preferred model

Recommended models:

  • llama3.1 - Balance between performance and capability
  • llama2 - Lighter alternative
  • mistral - Fast and efficient option

πŸ› οΈ Available Scripts

Command Description
npm run dev Start the server in development mode
npm run build Compile TypeScript to JavaScript
npm start Run the compiled server

πŸ§ͺ Testing

The project includes testing support with Vitest:

npm test

πŸ”Œ MCP Client Integration

This server can be used by any Model Context Protocol-compatible client. Resources and tools are exposed via:

  • MCP Resources: Accessible through URIs like interaction://interaction-flashcard
  • MCP Tools: Invokable via read_interaction_flashcard

πŸ“š Available Interactions

Flashcard

Interaction to create study cards with:

  • Text (question/answer)
  • Supporting images
  • Organizational categories
  • Dynamic transformations between editor and renderer

🀝 Contributing

  1. Fork the project
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ› Troubleshooting

Server won't start

  • Verify that port 3000 is not in use
  • Make sure you've run npm install

Ollama not responding

  • Verify that Ollama is running: ollama serve
  • Check that the model is downloaded: ollama list
  • Verify connectivity: curl http://localhost:11434/api/tags

TypeScript compilation errors

  • Make sure TypeScript is installed: npm install -g typescript
  • Clean and rebuild: rm -rf dist && npm run build

πŸ“„ License

ISC

πŸ‘₯ Author

Project developed as part of the GIM system (GestiΓ³n de Interacciones Multimodales - Multimodal Interaction Management)


Note: This project requires Ollama running locally to function correctly. Make sure you have the service active before starting the server.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured