RP

receptopalak/postgis-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

20 stars 3 forks 质量 59 趋势 10

Postgis MCP 服务器

概览

该项目是一个服务器应用,利用模型上下文协议(MCP)提供PostGIS数据库连接。 - 使用 TypeScript 开发 - 模型上下文协议(MCP)集成 - 支持 PostGIS 数据库 - 开发和生产环境配置 - 热重载支持 - Node.js(v14及更高版本)- PostgreSQL(带PostGIS扩展)- npm或yarn 遗留的单数据库DB_HOST / DB_NAME / DB_USER / DB_PASSWORD变量仍被支持作为备用。 4. 可选:在 domain-aliases.json 中自定义表/域别名以改善自然语言表的选择。 你可以使用以下示例配置进行MCP服务器: - @modelcontextprotocol/SDK: ^1.12.1 - dotenv: ^16.5.0 - pg: ^8.16.0 - zod: ^3.25.64 1. fork这个仓库 2.创建你的功能分支(git checkout -b feature/amazing-feature) 3.提交你的更改(git commit -m 'feat: Add some amazing feature') 4.推送到分支(git push origin feature/amazing-feature) 5.

概述(AI 翻译)

英文 |土耳其语

PostGIS MCP 服务器

该项目是一个服务器应用,利用模型上下文协议(MCP)提供PostGIS数据库连接。

🚀 特色

  • 使用 TypeScript 开发
  • 模型上下文协议(MCP)集成
  • PostGIS数据库支持
  • 开发和生产环境配置
  • 热装填支持

📋 要求

  • Node.js(v14或更高)
  • PostgreSQL(带PostGIS扩展)
  • NPM或纱线

🛠️ 安装

  1. 项目克隆:

  2. 安装依赖:

  3. 创建 .env 文件:

遗留单数据库的DB_HOST / DB_NAME / DB_USER / DB_PASSWORD 变量仍作为备用支持。

  1. 可选:在 domain-aliases.json 中自定义表/域别名以改进自然语言表的选择。

🚀 用途

开发模式

制作模式

🔧 MCP 配置

你可以使用以下示例配置进行MCP服务器:

📦 依赖关系

  • @modelcontextprotocol/SDK:^1.12.1
  • dotenv: ^16.5.0
  • 页码:^8.16.0
  • 佐德:^1964年3月25日

🤝 贡献

  1. 分支该仓库
  2. 创建你的特征分支([git checkout -b feature/amazing-feature)

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

PostGIS MCP Server

English | Türkçe

PostGIS MCP Server

This project is a server application that provides PostGIS database connection using Model Context Protocol (MCP).

🚀 Features

  • Developed with TypeScript
  • Model Context Protocol (MCP) integration
  • PostGIS database support
  • Configuration for development and production environments
  • Hot-reload support

📋 Requirements

  • Node.js (v14 or higher)
  • PostgreSQL (with PostGIS extension)
  • npm or yarn

🛠️ Installation

  1. Clone the project:
git clone https://github.com/receptopalak/postgis-mcp.git
cd postgis-mcp
  1. Install dependencies:
npm install
  1. Create .env file:
NODE_ENV=development
DB_URL_1=postgres://user:password@host:5432/database_one
DB_URL_2=postgres://user:password@host:5432/database_two
DB_URL_3=postgres://user:password@host:5432/database_three

Legacy single-database DB_HOST / DB_NAME / DB_USER / DB_PASSWORD variables are still supported as a fallback.

  1. Optional: customize table/domain aliases in domain-aliases.json to improve natural-language table selection.

🚀 Usage

Development Mode

npm run dev

Production Mode

npm run build
npm start

🔧 MCP Configuration

You can use the following example configuration for MCP server:

{
  "mcpServers": {
    "postgis": {
      "command": "npx",
      "args": ["tsx", "server.ts"],
      "env": {
        "NODE_ENV": "development",
        "DB_URL_1": "postgres://user:pass@host:5432/db_one",
        "DB_URL_2": "postgres://user:pass@host:5432/db_two"
      }
    }
  }
}

📦 Dependencies

  • @modelcontextprotocol/sdk: ^1.12.1
  • dotenv: ^16.5.0
  • pg: ^8.16.0
  • zod: ^3.25.64

🤝 Contributing

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

📝 License

This project is licensed under the ISC License. See the LICENSE file for more information.

📧 Contact

Project Owner - @receptopalak

Project Link: https://github.com/receptopalak/postgis-mcp


PostGIS MCP Server

Bu proje, Model Context Protocol (MCP) kullanarak PostGIS veritabanı bağlantısını sağlayan bir sunucu uygulamasıdır.

🚀 Özellikler

  • TypeScript ile geliştirilmiş
  • Model Context Protocol (MCP) entegrasyonu
  • PostGIS veritabanı desteği
  • Geliştirme ve üretim ortamları için yapılandırma
  • Hot-reload desteği

📋 Gereksinimler

  • Node.js (v14 veya üzeri)
  • PostgreSQL (PostGIS eklentisi ile)
  • npm veya yarn

🛠️ Kurulum

  1. Projeyi klonlayın:
git clone https://github.com/receptopalak/postgis-mcp.git
cd postgis-mcp
  1. Bağımlılıkları yükleyin:
npm install
在 GitHub 查看完整 README

安装

npx tsx server.ts
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "postgis": { "command": "npx", "args": ["tsx", "server.ts"], "env": { "NODE_ENV": "development", "DB_URL_1": "postgres://user:pass@host:5432/db_one", "DB_URL_2": "postgres://user:pass@host:5432/db_two" } } } }