Skip to content

Cleobury/fabric_mcp

Repository files navigation

Fabric GraphQL MCP Server

This MCP server provides a natural language interface to a Microsoft Fabric GraphQL endpoint.

Features

  • Test Connection: specific tool to verify connectivity and auth.
  • Execute Query: Runs GraphQL queries against the configured Fabric endpoint.
  • Reporting & Visualization:
    • CSV Reports: generate_csv_report
    • Excel Reports: generate_excel_report (Rich formatting)
    • Charts: visualize_data (Bar, Line, Scatter, Pie)

Setup

1. Installation

The easiest way to get started is to install the package and its dependencies using the provided installer.

Option A: Installer (Recommended)

This will install the server in editable mode and generate configuration templates.

python install.py

Option B: Manual Setup

pip install -r requirements.txt
pip install -e .

2. Configuration

After installation, you must configure the server with your Microsoft Fabric GraphQL endpoint details.

The installer generates template snippets:

  • COPILOT_CONFIG_SNIPPET.json for GitHub Copilot.
  • GEMINI_CONFIG_SNIPPET.json for Gemini.

Required Environment Variables:

  • FABRIC_GRAPHQL_ENDPOINT: Your Microsoft Fabric GraphQL API endpoint URL.
  • FABRIC_TOKEN (Optional): A direct access token (Bearer token).
    • If provided, this is used for the Authorization header.
    • If NOT provided, the server attempts to use DefaultAzureCredential.

3. Client Integration

Copy the configured snippet into your client's settings.

Option A: GitHub Copilot

Add the snippet to your ~/.copilot/mcp-config.json (User-level) or .copilot/mcp-config.json (Repository-level).

{
  "mcpServers": {
    "fabric-graphql": {
      "command": "python",
      "args": ["-m", "fabric_mcp.server"],
      "env": {
        "FABRIC_GRAPHQL_ENDPOINT": "https://<your-fabric-endpoint>/graphql",
        "FABRIC_TOKEN": "<your-access-token>"
      }
    }
  }
}

Option B: Gemini (e.g. Gemini Desktop)

Add the following to your gemini-extension.json or global configuration.

{
  "id": "fabric-graphql",
  "command": "python",
  "args": ["-m", "fabric_mcp.server"],
  "env": {
    "FABRIC_GRAPHQL_ENDPOINT": "https://<your-fabric-endpoint>/graphql",
    "FABRIC_TOKEN": "<your-access-token>"
  }
}

Tools

  • test_connection: Pings the endpoint to verify setup.
  • execute_fabric_query(query): Runs a GraphQL query.
  • generate_csv_report(data_json, filename): Saves the last result to a CSV.

Troubleshooting

"Introspection is not allowed" (Error HC0046)

Fabric defaults to disabling GraphQL introspection for security. To fix this:

  1. Option A (Recommended): Enable it in Fabric.
    • Go to your Fabric Workspace.
    • Open the API for GraphQL item.
    • Look for "Security" or "Settings".
    • Check "Allow introspection".
  2. Option B (Manual):
    • Copy the Schema (SDL) from the Fabric portal (there is usually a "Copy Schema" button).
    • Paste it into a file named schema.graphql inside a docs folder in this project: <PROJECT_ROOT>/docs/schema.graphql.
    • The tool will read this file instead of asking the server.

About

MCP Server to connect Fabric + GraphQL to your LLM of choice

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages