Server For Ollama Blog
БесплатноНе проверенExposes a blog CRUD API (posts and comments) as MCP tools, with an integrated AI chatbot agent powered by Ollama Gemma2 for natural language interaction.
Описание
Exposes a blog CRUD API (posts and comments) as MCP tools, with an integrated AI chatbot agent powered by Ollama Gemma2 for natural language interaction.
README
This repository contains a small blog-style application with two working flows:
- An AI chatbot flow where natural language requests are translated into real actions against the posts and comments API.
- An MCP flow where an MCP client calls the MCP endpoint and performs real actions through exposed tools.
The project is split into two services:
- Main REST API server: server.js
- MCP server with Ollama integration: mcp-server/server.js
What the app does
The main API stores and manages posts and comments in MongoDB.
- Posts contain: title, author, category, body, createdAt
- Comments belong to a post and contain: postId, text, commenter, createdAt
The MCP server adds two higher-level interaction paths on top of that REST API.
Architecture
Flow 1: AI chatbot -> REST API -> MongoDB
This flow is used when a user talks to the chatbot interface or sends a request to the AI endpoint.
- A user sends a message such as “Create a new post...” to the chatbot UI or to the AI endpoint.
- The MCP server sends the message to Ollama.
- Ollama returns an action plan such as create_post, list_posts, add_comment, and so on.
- The MCP server executes that action by calling the main REST API.
- The REST API updates MongoDB and returns the result.
This path is used by:
- the chatbot page at public/chatbot.html
- the endpoint POST /ai-chatbot on the MCP server
Flow 2: MCP client -> /mcp -> tools -> REST API -> MongoDB
This flow is used when an MCP client connects to the MCP server.
- The MCP client sends a JSON-RPC request to POST /mcp.
- The MCP server handles initialization and tool calls.
- The server invokes registered tools such as create_post, list_posts, update_post, delete_post, add_comment, and list_comments.
- Each tool calls the main REST API.
- The REST API performs the action in MongoDB.
This is the path used by MCP-compatible clients.
Project structure
- server.js: Main REST API for posts and comments
- public/: Web UI for the blog and chatbot experience
- public/chatbot.html: AI chatbot UI
- mcp-server/server.js: MCP server with AI and tool support
- mcp-server/README.md: MCP-specific details
Setup
1. Install dependencies
From the project root:
npm install
Then install the MCP server dependencies:
cd mcp-server
npm install
2. Configure MongoDB
Set the MongoDB connection string for the main API:
export MONGO_URI="mongodb://localhost:27017/mcp-api"
3. Install Ollama
Make sure Ollama is running locally and that the model is available.
ollama pull gemma2
Run the services
Start the main REST API
From the project root:
npm start
The main API runs on:
Start the MCP server
In a second terminal:
cd mcp-server
npm start
The MCP server runs on:
Open the UI
- Main blog UI: http://localhost:3002/
- Chatbot UI: http://localhost:5001/
API endpoints
Base URL for the main REST API:
Posts
- POST /posts: create a post
- GET /posts: list posts
- GET /posts/:id: get one post
- PUT /posts/:id: update a post
- DELETE /posts/:id: delete a post and its comments
Comments
- POST /posts/:id/comments: add a comment
- GET /posts/:id/comments: list comments for a post
Validation rules
Posts require:
- title: minimum 5 characters
- author: minimum 3 characters
- category: tech, finance, or lifestyle
- body: minimum 50 characters
Comments require:
- text: minimum 10 characters
- commenter: required
AI chatbot flow
The AI chatbot flow is handled by the MCP server.
Endpoint
- POST /ai-chatbot on the MCP server
How it works
- The client sends a natural language message.
- The MCP server asks Ollama to interpret the request.
- Ollama returns an action such as create_post or add_comment.
- The MCP server executes that action by calling the main REST API.
- The result is returned to the client in a structured response.
Example
curl -X POST http://localhost:5001/ai-chatbot \
-H "Content-Type: application/json" \
-d '{"message":"Create a new post about AI trends"}'
MCP flow
The MCP flow is handled by the MCP server over Streamable HTTP.
Endpoint
- POST /mcp
How it works
- An MCP client sends a JSON-RPC request to /mcp.
- The MCP server initializes the connection and handles tool calls.
- Tools such as create_post, list_posts, update_post, delete_post, add_comment, and list_comments are executed.
- Each tool calls the REST API and returns the response.
Example MCP action
An MCP client can call the create_post tool to create a post, and the server will forward that action to the main API.
Tool summary
The MCP server exposes these tools:
- create_post
- list_posts
- get_post
- update_post
- delete_post
- add_comment
- list_comments
- ai_chatbot_agent
Notes
- The main REST API is the data layer.
- The MCP server is the orchestration layer for AI and MCP clients.
- The chatbot and MCP client are both real action executors, not just read-only assistants.
Установка Server For Ollama Blog
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/varun123936/mcp-server-ollamaFAQ
Server For Ollama Blog MCP бесплатный?
Да, Server For Ollama Blog MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Server For Ollama Blog?
Нет, Server For Ollama Blog работает без API-ключей и переменных окружения.
Server For Ollama Blog — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Server For Ollama Blog в Claude Desktop, Claude Code или Cursor?
Открой Server For Ollama Blog на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Fetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzCompare Server For Ollama Blog with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai
