mcp-agent-app
Converts GeoJSON geometries into 3D triangulated meshes using a local LLM (Ollama), exposing an MCP tool for mesh generation.
README
mcp-agent-app
A TypeScript service that converts GeoJSON geometries into 3D triangulated meshes using a local LLM (Ollama). It exposes an MCP tool (generate_mesh) and an HTTP API, making mesh generation accessible both to MCP-compatible clients and standard REST consumers.
POST /generate-mesh
│
▼
Express API (src/api/index.ts)
│
▼
generateMeshAgent (src/agents/generate_mesh_agent.ts)
│
▼
Ollama LLM ──────────────────────────────────────────> MeshData
(llama3.2 @ localhost:11434) { vertices, indices, metadata }
MCP server (src/server.ts) exposes the same agent as an MCP tool over stdio
Stack
| Layer | Technology |
|---|---|
| Language | TypeScript 5 (strict, ES2022, ESM) |
| Runtime | Node.js 18+ with tsx for development |
| Web framework | Express 4 |
| MCP SDK | @modelcontextprotocol/sdk v1.29, @modelcontextprotocol/server v2.0 alpha |
| Schema validation | Zod |
| Local LLM | Ollama (llama3.2 at http://localhost:11434) |
Note: The MCP server and HTTP API use Ollama for inference — no Anthropic API key is required for the core mesh generation.
ANTHROPIC_API_KEYis only needed if you extend the agent loop with Claude tool-use.
Project structure
src/
├── server.ts # MCP server — registers and runs the generate_mesh tool
├── agents/
│ └── generate_mesh_agent.ts # Core logic: GeoJSON → Ollama → MeshData
└── api/
└── index.ts # Express HTTP API wrapping the agent
Prerequisites
- Node.js 18+
- Ollama running locally with the
llama3.2model pulled:ollama pull llama3.2 ollama serve # must be running on http://localhost:11434
Setup
npm install
Run (dev, no build step)
npm run dev # starts the Express API on port 3000 (default)
In another terminal:
curl -X POST http://localhost:3000/generate-mesh \
-H "Content-Type: application/json" \
-d '{"geometry": "{\"type\":\"Polygon\",\"coordinates\":[[[0,0],[1,0],[1,1],[0,1],[0,0]]]}"}'
The geometry field accepts either a JSON string or a parsed GeoJSON object (Geometry or Feature).
Expected response shape:
{
"vertices": [0, 0, 0, 1, 0, 0, ...],
"indices": [0, 1, 2, ...],
"metadata": {
"featureType": "Polygon",
"vertexCount": 8,
"triangleCount": 4
}
}
Mesh conventions
| Geometry type | Mesh output |
|---|---|
| Polygon / MultiPolygon | Flat base (z=0) + extruded top (z=10) + side walls |
| LineString | Ribbon mesh, width 0.0001° |
| Point | Small pyramid |
Coordinates map as: longitude → x, latitude → y, elevation → z.
Build & run (production)
npm run build
npm start
Run the MCP server standalone
npm run mcp
# or inspect it interactively:
npx @modelcontextprotocol/inspector npx tsx src/server.ts
The MCP server exposes one tool — generate_mesh — that accepts a GeoJSON geometry or Feature as a JSON string and returns the same MeshData structure as the HTTP API.
NPM scripts
| Script | Description |
|---|---|
npm run dev |
Start API in watch mode via tsx |
npm start |
Run compiled dist/api/index.js |
npm run build |
Compile TypeScript to dist/ |
npm run mcp |
Run the MCP server standalone |
Environment variables
| Variable | Default | Description |
|---|---|---|
PORT |
3000 |
Express server port |
CORS_ORIGINS |
http://localhost:5173 |
Comma-separated list of allowed CORS origins |
Notes
- The MCP server logs to stderr, never stdout — stdout is the stdio protocol channel.
- Ollama responses are validated with a Zod schema; a regex fallback handles markdown-wrapped JSON output.
- The HTTP API allows requests with no
Originheader (server-to-server calls) in addition to the CORS allowlist. - For production: TLS at a reverse proxy, auth + rate limiting in front of
/generate-mesh, and request timeouts viaAbortController. - To swap in a remote MCP server, replace
StdioClientTransportwithStreamableHTTPClientTransportin the MCP manager.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.