Skip to main content

Serveur MCP pour accéder aux données INSEE (SIRENE, BDM, Nomenclatures)

Project description

INSEE MCP Server

Serveur MCP (Model Context Protocol) pour accéder aux données de l'INSEE via l'API SIRENE, BDM et les nomenclatures officielles.

⚡ Installation en une ligne

Avec uv (recommandé)

# Installation et lancement direct
API_KEY="your_insee_api_key" uv run --with insee-mcp insee-mcp

Configuration MCP standard

Ajoutez ceci à votre configuration MCP (ex: Claude Desktop) :

{
  "mcpServers": {
    "insee": {
      "command": "uv",
      "args": ["run", "--with", "insee-mcp", "insee-mcp"],
      "env": {
        "API_KEY": "votre_clé_api_insee"
      }
    }
  }
}

Avec pipx

API_KEY="your_insee_api_key" pipx run --spec git+https://github.com/KerryanOPMace/mcp-insee.git insee-mcp

🚀 Installation rapide

Installation directe (recommandée)

# Installation directe depuis GitHub
pip install git+https://github.com/KerryanOPMace/mcp-insee.git

# Configurer votre clé API INSEE
export API_KEY="votre_clé_api_insee"

# Lancer le serveur
insee-mcp

Installation avec pipx (isolée)

# Installation avec pipx (environnement isolé)
pipx install git+https://github.com/KerryanOPMace/mcp-insee.git

# Configurer la clé API
export API_KEY="votre_clé_api_insee"

# Lancer le serveur
insee-mcp

Installation pour développeurs

# Cloner le repository
git clone https://github.com/KerryanOPMace/mcp-insee.git
cd mcp-insee

# Installer en mode développement
pip install -e .

🔑 Configuration

Clé API INSEE

Vous devez obtenir une clé API sur le portail API de l'INSEE et la configurer :

Linux/Mac :

export API_KEY="votre_clé_api_insee"

Windows (PowerShell) :

$env:API_KEY="votre_clé_api_insee"

Windows (CMD) :

set API_KEY=votre_clé_api_insee

🛠️ Outils disponibles

  • search_company : Recherche d'entreprises dans la base SIRENE
    • Par SIREN, SIRET ou nom d'entreprise
    • Recherche approximative disponible

🌐 Accès au serveur

Une fois lancé, le serveur MCP est accessible à :

  • URL : http://127.0.0.1:8000/mcp
  • Transport : Streamable HTTP

🧪 Test du client

from fastmcp import Client
import asyncio

async def test():
    client = Client("http://127.0.0.1:8000/mcp")
    async with client:
        # Lister les outils
        tools = await client.list_tools()
        print(tools)
        
        # Rechercher une entreprise
        result = await client.call_tool("search_company", {
            "siret": "44302124100072"
        })
        print(result)

asyncio.run(test())

📋 Prérequis

  • Python 3.8+
  • Clé API INSEE valide
  • Accès internet pour les requêtes API

📄 Licence

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

insee_mcp-0.1.7.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

insee_mcp-0.1.7-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file insee_mcp-0.1.7.tar.gz.

File metadata

  • Download URL: insee_mcp-0.1.7.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for insee_mcp-0.1.7.tar.gz
Algorithm Hash digest
SHA256 d8b0048515500a6c158be5793bec8c7125c49cc85b3e19d8b96c5f3361c96d6a
MD5 4edb3797dcc759d123f5de8840790d82
BLAKE2b-256 14450ec5a4e6bfc557c363041ea424b5b02730aeab68a08f7677419676ce1386

See more details on using hashes here.

File details

Details for the file insee_mcp-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: insee_mcp-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for insee_mcp-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c3525de765c70c4a372aa2d94dd00e248918dd17b6ab169d15e219c6be152ef4
MD5 8388063ac6f7b4d9f7cf0618a4f8fed8
BLAKE2b-256 959a7d2bd44238a6ce941f753e6c46cff0c557f8d92a3d15e2712d782e46d8e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page