MCP Server (MCP Protocol Compliant)
Git-Fg
README
MCP Server (MCP Protocol Compliant)
Overview
This server is now a standards-compliant Model Context Protocol (MCP) server. It exposes document generation as an MCP tool, allowing integration with AI hosts (e.g., Copilot, Cursor, Claude Desktop) via the MCP protocol.
MCP Features
- MCP Tool:
generateDocument
— Generate PDF, DOCX, PPTX, or XLSX files from a prompt. - Transport: Stdio (local, default). SSE (network) can be added if needed.
- Schema Validation: Uses zod for input validation.
- Extensible: Add more tools/resources/prompts as needed.
Features
- Document Generation: Create PDF, Word, PowerPoint, and Excel files from AI-driven prompts.
- Image Embedding & Resizing: Insert and resize images in DOCX and PPTX files.
- Asynchronous Processing: Queue and process document generation jobs using BullMQ and Redis.
- Validation: Validate document layout by capturing and analyzing screenshots.
- API-First: RESTful endpoints for document generation, job status, and result retrieval.
- Extensible: Modular architecture for easy addition of new file types or tools.
Project Structure
src/
app.js
server.js
config/
controllers/
middleware/
public/
routes/
services/
utils/
workers/
temp_image/
validation-screenshots/
test-output/
Getting Started
Prerequisites
- Node.js (v14+ recommended)
- Redis server
Installation
- Clone the repository:
git clone <repository-url> cd mcp-server
- Install dependencies:
npm install
- Set up environment variables:
- Copy
.env.example
to.env
and fill in the required values.
- Copy
Running the Server
npm start
Running Tests
npx jest src/services/fileCreation.test.js --runInBand
API Endpoints
POST /documents/generate
— Request document generation (PDF, DOCX, PPTX, XLSX)GET /documents/generate/status/:jobId
— Check job statusGET /documents/generate/result/:jobId
— Download generated file
File Generation & Validation
- Supports AI-driven content and layout via Gemini/OpenAI function calling.
- Image insertion with resizing is available for DOCX and PPTX.
- Layout validation uses screenshots (mocked or real, see
aiFileValidationService
).
Example: Image Embedding & Resizing
- Place images in
temp_image/
(e.g.,temp_image/blackboard-with-camera-leaf.jpg
). - Use function calls like:
{ name: 'addImage', arguments: { path: 'temp_image/blackboard-with-camera-leaf.jpg', options: { width: 150, height: 150 } } }
Usage
Build and Start
npm run build
npm start
MCP Host Configuration Example (stdio)
Add to your host's mcp.json
(e.g., for Cursor, VS Code, Claude Desktop):
{
"mcpServers": {
"document-server": {
"command": "/usr/local/bin/node",
"args": ["/absolute/path/to/build/index.js"]
}
}
}
Debugging with MCP Inspector
You can test this server using the official MCP Inspector:
npx @modelcontextprotocol/inspector node build/index.js
Extending
- Add more tools/resources in
src/index.ts
using the MCP SDK. - For SSE/network transport, see the MCP SDK docs and the guide.
Security & Best Practices
- Always validate and sanitize tool/resource inputs.
- Never expose sensitive data without user consent.
- For remote/SSE deployments, implement authentication and TLS.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
MIT
This project now follows the official MCP server standards for Node.js/Typescript.
Recommended Servers
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.
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.
MCP Package Docs Server
Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.
Claude Code MCP
An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.
@kazuph/mcp-taskmanager
Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.
Linear MCP Server
Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.
mermaid-mcp-server
A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.
Jira-Context-MCP
MCP server to provide Jira Tickets information to AI coding agents like Cursor

Linear MCP Server
A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Sequential Thinking MCP Server
This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.