What is MCP Server?
Definition
An MCP (Model Context Protocol) Server is a standardized, open-source application layer that securely connects AI models to external data sources, internal APIs, and local files.
How Memora uses MCP Server
Memora runs an MCP server (the @memora/mcp-server npm package) that lets Claude Code, Cursor and other MCP clients ask questions about your team's connected tools.
Interactive MCP Quick-Starter
Connect your AI assistant to Memora's persistent memory layer. Runs locally over stdio.
{
"mcpServers": {
"memora-memory": {
"command": "npx",
"args": [
"-y",
"@memora/mcp-server@latest"
],
"env": {
"MEMORA_API_KEY": "YOUR_MEMORA_API_KEY",
"MEMORA_WORKSPACE_ID": "ws_enterprise_main"
}
}
}
}Why MCP Servers Matter
When organizations attempt to integrate Artificial Intelligence into their daily workflows, they hit an immediate roadblock: AI models don't naturally know how to read your private Jira tickets, query your secure PostgreSQL database, or understand your local GitHub repository.
Enter the MCP Server.
An MCP (Model Context Protocol) Server is a lightweight, standardized application layer that exposes specific local data sources, file systems, and internal APIs to an AI model. In this complete guide, we'll explain how MCP servers work, why MCP is becoming a standard way for AI applications to interact with tools and data sources, and how they act as the foundation for modern AI Agents.
What is an MCP Server?
An MCP Server is essentially a data provider in the Model Context Protocol architecture. It acts as a universal adapter between your private data and an AI application.
Think of it like a USB-C cable for AI. Before USB-C, every device required a proprietary charger. Before MCP, every AI model required custom, hardcoded integrations to talk to different databases or SaaS tools. An MCP server standardizes this connection: the developer writes the server logic once, and any AI client that speaks the Model Context Protocol can instantly understand and interact with that data.
MCP Server vs MCP Client
The Model Context Protocol architecture is divided into distinct roles:
| Component | Role |
|---|---|
| MCP Host | The AI application or environment running the agent. |
| MCP Client | Maintains the connection to an MCP server on behalf of the host. |
| MCP Server | Exposes tools, resources, and prompts to the client. |
How Does an MCP Server Work?
The Model Context Protocol operates on a strict client-server architecture.
- The Client (AI Host): The application running the AI model initiates a connection.
- The Server (Data Provider): The MCP server listens for requests, translates them into local actions (like a SQL query or a file read), and returns the results to the AI.
Communication commonly uses stdio (standard input/output) for local, process-spawned integrations and Streamable HTTP for remote MCP servers. Legacy HTTP+SSE remains supported for backwards compatibility, but the MCP project has deprecated it in favor of Streamable HTTP.
MCP Server Architecture
An MCP server exposes three core primitives to the AI client:
- Resources: Read-only data. An MCP server can expose a specific configuration file, a list of Slack messages, or database schemas. The AI reads this context to understand its environment.
- Tools: Executable actions. Tools are functions the AI can trigger. For example, an MCP server might provide a tool called
execute_sql_query. The AI decides to call this tool, the server executes it, and returns the result. - Prompts: Pre-written templates that the MCP server provides to the AI to ensure it formats queries or handles the specific data source correctly.
MCP Server vs API: What's the Difference?
While both MCP servers and standard REST APIs connect systems together, they are built with different consumers in mind.
- REST APIs provide general-purpose programmatic interfaces. They require hardcoded integration, rigid JSON schemas, and manual error handling by human developers.
- MCP provides a standardized interface specifically designed for AI applications to discover and interact with tools, resources, and prompts.
The client can discover the server's available capabilities and then decide which tools or resources are relevant to the task.
MCP Server vs RAG
While they both help AI models access data, they are fundamentally different:
- MCP is a standardized access/interface protocol. It dictates how the AI communicates with a system.
- RAG (Retrieval-Augmented Generation) is a retrieval and generation approach. It dictates what data is pulled and injected into the prompt.
They can work together seamlessly. An AI might use an MCP Server to securely query a vector database (performing RAG) to pull relevant enterprise context.
What Is an MCP Server Used For?
By acting as the hands and eyes of an AI, MCP servers unlock powerful enterprise use cases, including:
- Connecting AI directly to secure databases.
- Accessing local files and codebases securely.
- Interacting dynamically with SaaS tools (like GitHub or Jira).
- Giving autonomous agents controlled tools to execute approved actions.
- Retrieving enterprise context to build Organizational Memory.
MCP Server Examples
The open-source community has rapidly built a massive ecosystem of MCP servers. Some popular examples include:
- PostgreSQL MCP Server: Allows an AI to read schemas and execute read-only queries against a private database.
- GitHub MCP Server: Lets an AI read repositories, review pull requests, and create issues.
- Google Drive MCP Server: Connects an AI to a corporate Drive to search and summarize documents.
How to Build an MCP Server
Building an MCP Server is surprisingly straightforward, especially using official SDKs available in TypeScript and Python.
At a high level, the process involves:
- Importing the MCP SDK.
- Defining a
Serverinstance. - Registering Tools (e.g.,
server.tool("read_file", ...)). - Registering Resources and Prompts.
- Starting the server via the
stdioor Streamable HTTP transport layer.
The MCP Server Lifecycle, Step by Step
The communication between an MCP Client and an MCP Server follows a strict, predictable 4-stage lifecycle over JSON-RPC 2.0:
[MCP Client / LLM] [MCP Server]
│ │
│ 1. Initialize Request (capabilities, protocolVersion)│
├────────────────────────────────────────────────────►│
│ 2. Initialize Response (server capabilities) │
│◄────────────────────────────────────────────────────┤
│ │
│ 3. Discovery: tools/list, resources/list │
├────────────────────────────────────────────────────►│
│ 4. Capabilities Catalog (Schemas, Parameters) │
│◄────────────────────────────────────────────────────┤
│ │
│ 5. Tool Call: tools/call {name: "query_repo", ...} │
├────────────────────────────────────────────────────►│ (Executes locally)
│ 6. Tool Result: {content: [...], isError: false} │
│◄────────────────────────────────────────────────────┤
Stage 1: Handshake and Initialization
When the Host application launches, it spawns the MCP server as a sub-process (via stdio) or establishes an HTTP connection (via SSE). The client sends an initialize request specifying supported protocol versions. The server responds with its metadata, server version, and enabled capabilities.
Stage 2: Capability Discovery
The client queries the server to discover what it can do:
resources/list: Discovers available documents and data feeds.prompts/list: Discovers pre-configured prompt workflows.tools/list: Discovers executable functions along with strict JSON Schema definitions for expected parameters.
Stage 3: Dynamic Context Injection & Tool Calling
When a user asks a question, the LLM inspects the available tools and resources. If the LLM determines it needs external information:
- It produces a structured tool call.
- The MCP Client transmits a
tools/callJSON-RPC payload to the server. - The server validates parameters against the schema, queries the underlying database or API, sanitizes the result, and responds.
Stage 4: Synthesis
The MCP Client places the sanitized server response back into the LLM's context window, allowing the model to generate an answer grounded in real data rather than guesswork.
The Three Core MCP Primitives: Resources, Prompts and Tools
Every MCP server exposes its functionality through three standardized primitives:
1. Resources (Read-Only Data)
Resources expose contextual data that an LLM can read, similar to files or GET requests in REST APIs. Resources have unique URIs:
postgres://production_db/schema/usersgithub://repos/memora/core-engine/pull/402memora://knowledge-graph/entity/AuthService
When an LLM accesses a resource, the server streams the raw text or binary data directly into the model's context.
2. Prompts (Pre-Tuned Templates)
Prompts are reusable, server-defined conversational templates that guide both the human user and the LLM through complex workflows.
For example, a Jira MCP server might expose a triage_incident prompt with predefined arguments (incident_id, severity). When invoked, the server pulls the incident history, related Slack channels, and deployment commits into a battle-tested prompt template.
3. Tools (Executable Actions)
Tools are executable functions that allow the AI model to perform side effects in the real world:
- Querying a database (
execute_sql) - Creating a Jira issue (
create_ticket) - Triggering a CI/CD pipeline (
trigger_github_action) - Querying organizational memory (
query_memora_memory)
Each tool defines an inputSchema using JSON Schema, allowing the model to generate strictly validated arguments.
Example: An MCP Tool Definition and Call
Here is how an MCP Server exposes a tool using the official TypeScript SDK:
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
const server = new McpServer({
name: "enterprise-memory-server",
version: "1.0.0"
});
// Expose an executable Tool
server.tool(
"search_corporate_memory",
{
query: z.string().describe("The natural language question or topic to search"),
department: z.enum(["engineering", "product", "all"]).default("all")
},
async ({ query, department }) => {
// Queries the knowledge graph using this server's own credentials
const memoryResults = await queryMemoraKnowledgeGraph(query, department);
return {
content: [
{
type: "text",
text: JSON.stringify(memoryResults, null, 2)
}
]
};
}
);
// Connect via standard I/O
const transport = new StdioServerTransport();
await server.connect(transport);
MCP Transport Protocols: stdio vs Streamable HTTP
MCP defines two primary transport mechanisms:
1. Standard Input/Output (stdio)
- How it works: The host application spawns the MCP server as a child subprocess and communicates directly over standard input and standard output streams (
stdin/stdout). - Best for: Local desktop tools, local database connections, and IDE plugins.
- Benefits: Extreme speed, zero network latency, and maximum security (the server does not open any external network ports).
2. Streamable HTTP (and Legacy SSE)
- How it works: The MCP server runs as a remote microservice. Communication occurs over HTTP POST with Server-Sent Events (SSE) for streaming updates.
- Best for: Cloud-hosted enterprise memory systems, shared corporate databases, and SaaS platforms.
- Benefits: Multi-tenant scalability and centralized access control across distributed engineering teams.
How to Connect an MCP Server to Cursor and Claude Desktop
Configuring an MCP server is straightforward. Here is how to configure both popular environments:
1. Configuring Cursor IDE
Cursor supports native MCP servers via its configuration dashboard:
- Open Cursor Settings (
Ctrl+Shift+JorCmd+Shift+J). - Navigate to Features → MCP Servers.
- Click Add New MCP Server.
- Configure the server definition:
{
"mcpServers": {
"memora-memory": {
"command": "npx",
"args": [
"-y",
"@memora/mcp-server",
"--api-key",
"YOUR_ENTERPRISE_API_KEY"
]
}
}
}
2. Configuring Claude Desktop
Claude Desktop stores MCP server definitions in a local JSON configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Add your server configuration:
{
"mcpServers": {
"company-knowledge-graph": {
"command": "node",
"args": ["C:/Tools/memora-mcp/dist/index.js"],
"env": {
"MEMORA_WORKSPACE_ID": "ws_enterprise_prod",
"MEMORA_TOKEN": "sec_live_9482947192"
}
}
}
}
Once saved, restart Claude Desktop or Cursor. You will see a small hammer icon indicating that the AI client has successfully connected to your MCP server and loaded its tools.
For a detailed walkthrough, follow our comprehensive guide on how to use an MCP server.
MCP Servers for AI Agents
We are moving past simple chat interfaces into the era of autonomous AI Agents. An agent needs to perceive its environment and take action.
MCP servers are the hands and eyes of these agents. Instead of giving an agent broad, dangerous access to the internet, you confine the agent to a specific set of MCP servers. The agent uses the MCP server's tools to navigate the environment, achieving its goals securely.
MCP Server Security
MCP provides a standardized interface, but security still depends on how the server, client, authentication, authorization, and underlying data sources are configured.
- Local Execution Options: An MCP server can run within your own infrastructure, allowing organizations to keep data access and processing within controlled environments depending on their architecture.
- Granular Permissions: You strictly define what the AI can do. If you only expose a
read_tickettool, it is impossible for the AI to accidentally delete a ticket. - Human-in-the-Loop: MCP clients can be configured to prompt a human for approval before the MCP server executes a sensitive tool.
Frequently Asked Questions (FAQ)
What is an MCP server?
An MCP (Model Context Protocol) server is an open-standard software component that exposes local files, databases, APIs, and tools to artificial intelligence models via standardized JSON-RPC protocols. It acts as a universal adapter between private data and AI host applications like Claude Desktop, Cursor, and enterprise agents.
What is an MCP server in AI?
In AI, an MCP server provides the runtime context and tool execution interface that transforms a stateless Large Language Model into an interactive agent. Rather than requiring brittle, custom point-to-point API connectors, an MCP server allows any AI model speaking the Model Context Protocol to dynamically discover available resources and invoke tools securely.
How do MCP servers work?
MCP servers operate on a client-server architecture:
- An AI client (like Claude or an IDE) discovers the tools and resources exposed by the MCP server.
- When the user asks a question requiring external data, the AI model issues a structured JSON-RPC tool call request to the server.
- The MCP server executes the command locally (e.g. running a SQL query or reading a Git commit) and returns the result to the model.
- The AI incorporates the returned data into its response, grounding the answer in real results rather than memory alone.
What are MCP servers used for?
MCP servers are used to connect AI applications to:
- Enterprise databases (PostgreSQL, MySQL, Snowflake) for natural language querying.
- Developer environments (Git, terminal, local filesystem) for autonomous coding assistance.
- SaaS platforms (Jira, Slack, Confluence) for contextual workplace search and task automation.
- Enterprise memory platforms like Memora for continuous institutional knowledge retrieval.
Does an MCP Server train the AI model on my data?
Not by itself. An MCP server only provides real-time context to the AI model during inference; the protocol has no training step. However, whatever the server returns is sent to the model provider as part of the prompt, so whether that data is retained or used for training depends on the model provider's terms.
Is MCP tied to a specific AI vendor?
No. MCP is an open-source standard. While created by Anthropic, it is vendor-neutral and adopted across Claude, Cursor, Windsurf, and custom enterprise agent frameworks.
Can I run an MCP server locally on my machine?
Yes. In fact, running locally via standard I/O (stdio) is the default setup for desktop clients like Claude Desktop and Cursor. Traffic between the client and a local stdio server stays on your machine, and the server opens no network ports. Keep in mind that the model provider still receives whatever the server returns into the prompt, and the server itself may call remote APIs depending on how it is built.
Does Memora offer an MCP server?
Yes. Memora provides an enterprise MCP server that connects your AI coding assistants and agents directly to your company's living organizational memory, allowing developers to instantly recall historical architectural decisions, Slack context, and PR discussions from inside their IDE.
Next Steps for Enterprise Teams
- Explore Memora's Organizational Memory Solution to see how MCP connects company context.
- Discover how engineering teams use MCP in our Engineering Use Cases Guide.
- View flexible deployment options on our Transparent Pricing Page.
Explore Related Concepts:
See how Memora connects your team’s knowledge.
Connect your first tool and ask a question about your own work.