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.
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
-
Node.js (v18 or higher)
- Download from: https://nodejs.org/
-
Ollama (Required for AI functionality)
- Windows: Download from https://ollama.com/download
- Linux/Mac:
curl -fsSL https://ollama.com/install.sh | sh
-
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
-
Clone the repository
git clone <repository-url> cd gim-mcp -
Install dependencies
npm install -
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
-
Build the project
npm run build -
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 capabilityllama2- Lighter alternativemistral- 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
- Fork the project
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - 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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。