MCP stands for Model Context Protocol. It is an open standard that allows AI applications to communicate with external tools, databases, files, and services through a standardized interface.
Think of MCP as a USB port for AI software: instead of writing a custom integration for every tool, you can build an MCP server that exposes capabilities to compatible AI clients.
How MCP works
AI client
OpenCode, Claude, or another MCP-compatible application
MCP protocol
Standardized requests and responses
For example, you could ask an AI assistant, "List all customers in my MariaDB database." The assistant can use an MCP server to call a database tool, retrieve the results, and present them to you.
The three main MCP capabilities
Capability | Purpose | Example |
|---|
Tools | Execute actions | Run a database query or create a customer |
Resources | Expose information | Read a configuration file or documentation |
Prompts | Provide reusable instructions | A standard code-review prompt |
An MCP server may implement one or more of these capabilities.
MCP in your development environment
Since you work with C++, PHP, MariaDB, Linux, and OpenCode, MCP could help connect your AI coding workflow to your existing development tools.
1. MariaDB MCP server
Ask your AI to inspect database schemas, generate SQL, analyze records, or perform approved CRUD operations.
2. Filesystem MCP server
Allow an AI client to inspect source code, read project documentation, and work with selected directories.
3. Custom C++ or PHP MCP server
Expose your own functions as tools that an AI can invoke, such as compiling a project, checking build errors, or generating a report.
MCP versus a traditional API
Traditional API | MCP |
|---|
Defines endpoints or operations for an application | Defines a standardized way for AI clients to discover and use tools and resources |
Usually requires application-specific integration | Allows compatible clients to use a common protocol |
Application determines how to invoke the API | AI client can discover available tools and decide when to call them, subject to its instructions and permissions |
MCP does not replace REST APIs, SQL, or your application code. An MCP server can use those technologies internally.
How MCP connects to OpenCode and Ollama
A typical local setup looks like this:
Ollama
Runs the language model
MCP servers
Provide external tools
The distinction is important:
Ollama runs the AI model.
OpenCode coordinates the coding task and tool use.
MCP servers provide standardized access to external capabilities.
The model must still be capable of tool use, and the client must support the necessary MCP features. Using MCP does not automatically make a model more intelligent or guarantee that every tool call will work.
Security note: An MCP server can have access to sensitive files, databases, or system commands. Give it only the permissions it needs, and require approval for destructive operations.
Official documentation: Model Context Protocol · OpenCode documentation