Directory structure
internal/ — Go’s convention enforces module privacy. There is no pkg/ directory.
Ports (interfaces)
The core defines three port interfaces that adapters implement:Data flow
- The MCP client sends a tool call (e.g.
describe_table) over stdio or HTTP - The MCP adapter routes it to the appropriate service
- The service calls the port interface (e.g.
SchemaExplorer.DescribeTable) - The Postgres adapter executes SQL against the database
- The policy engine enriches the response and applies column masks (if configured)
- The result is serialized to JSON and returned to the client
- If OpenTelemetry is enabled, spans and metrics are recorded at each step
Dependency injection
All dependencies are wired at startup incmd/isthmus/main.go. There is no global state, service locator, or runtime reflection:
Adding a new database adapter
To add support for a new database (e.g. MySQL):- Create
internal/adapter/mysql/ - Implement
port.SchemaExplorerandport.QueryExecutor - Wire the new adapter in
cmd/isthmus/main.gobased on the connection string scheme - Add integration tests using testcontainers