Skip to main content
Glama
ayabenz

NAV 2015 FastMCP Server

by ayabenz

NAV 2015 FastMCP Server

Production-ready FastMCP server for read-only Dynamics NAV 2015 analytics. The external MCP tool behavior is preserved while the code is split into Clean Architecture layers.

Tools

  • get_user_detail(emp_no: str)

  • get_user_permissions()

  • list_accessible_tables()

  • get_table_schema(navision_table_name: str)

  • execute_autonomous_readonly_query(sql_query: str)

Related MCP server: MSSQL MCP Server

Architecture

  • core/: configuration, database context manager, structured logging, exceptions, sessions, cache

  • models/: immutable dataclass domain models

  • repositories/: database and metadata access

  • services/: workflow rules, validation, and application behavior

  • orchestrator/: JSON contract preservation and service coordination

  • tools/: FastMCP tool registration

  • resources/: NAV object whitelist metadata

  • tests/: regression tests for workflow and SQL safety behavior

Configuration

Copy .env.example to .env and set the NAV SQL Server connection details.

Copy-Item .env.example .env

Important variables:

  • NAV_CONNECTION_STRING: pyodbc SQL Server connection string

  • NAV_COMPANY_PREFIX: NAV company table prefix used in metadata responses

  • MCP_HOST and MCP_PORT: SSE host and port

  • QUERY_ROW_LIMIT: maximum rows returned by read-only query execution

Run

Install with Python 3.13.5:

python -m pip install -e ".[dev]"

Run local stdio transport:

python app.py

Run SSE transport:

python app.py sse

The legacy launcher still works:

python nav2015_auto_sql_fastapi.py sse

Test And Quality

python -m unittest discover -s tests -v
python -m ruff format .
python -m ruff check .

Docker

docker build -t nav-2015-fastmcp .
docker run --env-file .env -p 8000:8000 nav-2015-fastmcp

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides database interaction and business intelligence capabilities, enabling users to run SQL queries, analyze business data, and automatically generate business insight memos for Microsoft SQL Server databases.
    39
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables read-only analysis of Soft1 ERP databases through guarded T-SQL queries, schema discovery, knowledge search, and CSV/XLSX exports.
    -
  • F
    license
    A
    quality
    C
    maintenance
    A read-only MCP server for SQL Server and PostgreSQL that enables exploring and querying databases (schemas, tables, views, procedures, indexes, foreign keys) and running arbitrary SELECT queries.
    37
    -