Skip to content

achillis2016/access-mcp-server

Repository files navigation

access-mcp-server

Author: achillis

MCP Server for Microsoft Access databases (.accdb / .mdb), implemented in Go.

Languages: English | 中文

Prerequisites

  • Windows 7 or later (uses OLE DB via COM automation)
  • Microsoft Access or Microsoft Access Database Engine must be installed
  • Architecture must match: 32-bit Go binary can only call 32-bit OLE DB drivers, and 64-bit binary can only call 64-bit drivers
    • If you have 32-bit Access installed, build with GOARCH=386
    • If you have 64-bit Access installed, build with GOARCH=amd64

Windows 7 support: Although this project is compiled with Go 1.25.7, it can still run on Windows 7 and later. Thanks to the go-legacy-win7 project for making this possible. Windows XP is explicitly not supported.

Download

MCP Client Configuration

Add to your MCP client config. The binary name must match your driver architecture:

{
  "mcpServers": {
    "access-mcp-server": {
      "command": "access-mcp-server-i386.exe",
      "args": []
    }
  }
}

If installed via go install, the binary is located at %GOPATH%\bin\access-mcp-server.exe. By default GOPATH is C:\Users\<username>\go, so the full path is:

C:\Users\<username>\go\bin\access-mcp-server.exe

If %GOPATH%\bin is in your PATH, you can run access-mcp-server.exe doctor directly.

Rename to match your driver architecture:

  • access-mcp-server-i386.exe for 32-bit OLE DB drivers
  • access-mcp-server-amd64.exe for 64-bit OLE DB drivers

If using release binaries:

  • Use access-mcp-server-i386.exe for 32-bit OLE DB drivers
  • Use access-mcp-server-amd64.exe for 64-bit OLE DB drivers

MCP Tools

Tool Description
discover_database Full database overview: tables, columns, row counts
get_schema_summary Quick summary: table names, row/col counts
list_tables List all tables
show_table Show table structure and 5 sample rows
explain_table Detailed table explanation: columns, types, relationships
list_columns List all column info for a table
get_table_info Detailed table info: row count, columns, samples
list_indexes List index info for database or specific table
query_database Execute SQL query
execute_sql Execute arbitrary SQL (SELECT, INSERT, UPDATE, DELETE, DDL)
smart_query Natural-language question, auto-builds query
get_database_info Database file info: size, modification time, table count
backup_database Backup database file
export_data Export table data to CSV or JSON
import_data Import data from CSV or JSON into a table

Install

Via go install

go install github.com/achillis2016/access-mcp-server/cmd/access-mcp-server@latest

The binary will be installed to %GOPATH%\bin\access-mcp-server.exe (default: C:\Users\<username>\go\bin\).

From Source

You must build a binary that matches your installed OLE DB driver architecture:

build_rel.bat

Or manually:

REM 32-bit (for 32-bit Access / ACE driver)
set GOARCH=386
go build -o bin\access-mcp-server-i386.exe -ldflags="-s -w" ./cmd/access-mcp-server

REM 64-bit (for 64-bit Access / ACE driver)
set GOARCH=amd64
go build -o bin\access-mcp-server-amd64.exe -ldflags="-s -w" ./cmd/access-mcp-server

Binaries are output to the bin/ directory.

CLI Commands

Command Usage Description
doctor access-mcp-server-i386.exe doctor [all] Diagnose environment and driver installation (default checks recommended providers for current binary architecture; all prints full probe details)
conn access-mcp-server-i386.exe conn <db_path> Test database connection, list tables
query access-mcp-server-i386.exe query <db_path> "<sql>" Execute SQL and print results

Troubleshooting

"Provider not found": Driver architecture doesn't match binary.

  • Install the matching Access Database Engine (32-bit or 64-bit)
  • Or rebuild with the matching GOARCH (see build_rel.bat)

doctor output seems inconsistent with actual connection:

  • doctor now defaults to architecture-aware checks for the current process to reduce cross-architecture false positives
  • Use doctor all when you need full probe details

"MSysObjects 上没有读取数据权限": Normal, server falls back to OpenSchema API.

How to Set MSysObjects Access Permissions (for More Stable Table Discovery)

While the server has OpenSchema and ADOX as fallback mechanisms, granting read permission on MSysObjects for .mdb files yields the most accurate table discovery. Steps:

Step 1: Show System Objects

Open Access → FileOptionsCurrent DatabaseNavigationNavigation Options, check "Show System Objects":

Step 1

Step 2: Open User and Group Permissions

FileInfoUsers and PermissionsUser and Group Permissions:

Step 2

Step 3: Grant Read Permission on MSysObjects

In the "User and Group Permissions" dialog, select the "Admin" user, select MSysObjects from the object list, check "Read Data" permission, then click OK:

Step 3

After setting permissions, tools like list_tables, discover_database, show_table, and others will correctly identify all user tables.

License

See LICENSE.

Acknowledgments

Disclaimer

Not all features have been thoroughly tested. If you encounter any bugs, please feel free to open an issue.

About

A mcp server used to operate microsoft access database.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors