How to Build an MCP Server: A Developer’s Guide (With Procore Example)

Having built more than 80 integrations across healthcare systems, enterprise SaaS platforms, and financial software over the past 14+ years, we have seen integration architecture evolve from simple API connections into complex ecosystems of workflows, scripts, and middleware. The same shift is happening in clinical settings, covered in healthcare AI agents powered by MCP. As organizations scale, these integrations often become difficult to maintain, expensive to operate, and fragile under change. That's the bigger shift how MCP will change how we build integrations covers.
Today, the rise of AI-driven systems is pushing this evolution even further. Instead of building and maintaining dozens of brittle integrations, developers can now expose capabilities through an MCP server and allow AI agents to orchestrate workflows dynamically.
This guide explains how to build an MCP server, explores its architecture in detail, and demonstrates a real-world implementation using the Procore API.
Understanding the MCP Server
The Model Context Protocol (MCP) is an emerging standard that defines how AI systems interact with external tools, APIs, and data sources. Rather than hardcoding integrations between systems, MCP introduces a structured approach where capabilities are exposed through a centralized MCP server.
At its core, MCP is built around three primitives:
Tools
Tools represent executable actions that an AI agent can perform. These include operations such as creating records, updating data, triggering workflows, or sending notifications. For example, a tool might allow an AI agent to create a new construction project or approve a financial transaction.
Resources
Resources are structured data sources that the AI can read and use. These can include APIs, databases, documents, or even real-time data streams. In a construction context, resources might include project data, cost reports, or change order records.
Prompts
Prompts define how the AI should behave. They provide instructions, constraints, and context that guide decision-making. Prompts can encode business rules such as approval thresholds, escalation logic, or workflow sequencing.
Together, these primitives enable AI agents to dynamically orchestrate workflows across multiple systems. Unlike traditional integrations, where every interaction must be predefined, MCP allows systems to adapt in real time based on context.
MCP Server Architecture

A well-designed MCP server follows a modular architecture that separates responsibilities across multiple layers.
API Layer
This layer handles incoming requests from AI agents or external systems. It exposes endpoints such as /tools, /resources, and /execute, allowing the agent to discover and interact with available capabilities.
Service Layer
The service layer contains the business logic. It defines how tools behave, how data is processed, and how workflows are executed. This is where validation, transformation, and orchestration logic reside.
Integration Layer
This layer connects the MCP server to external systems such as the Procore API. It handles authentication, request formatting, retries, and error handling.
Database Layer
The database layer stores contextual data, logs, and state information. This can include user actions, workflow history, and cached responses. In many implementations, teams use relational databases such as MCP SQL Server for structured storage.
This layered architecture ensures scalability, maintainability, and flexibility as the number of integrations grows. For the broader landscape, see the MCP stack: tools, frameworks, and best practices.
How to Build an MCP Server (Step-by-Step)
1. Define the Use Case
Before building an MCP server, clearly define the problem you are solving. Identify the systems involved, the workflows you want to automate, and whether AI-driven decision-making is actually required.
For example, if you are planning a Procore API integration with financial systems, determine whether the workflow requires dynamic decision-making or if it can be handled with a simple API integration.
2. Set Up the Development Environment
A typical MCP server setup includes:
- Python or TypeScript
- FastAPI or Express framework
- Authentication mechanisms such as OAuth or API keys
- HTTP client libraries for external API calls
Choosing the right stack depends on your team’s expertise and the complexity of the integration.
3. Design MCP Components
Define the tools, resources, and prompts that your server will expose.
- Tools should represent meaningful business actions
- Resources should provide structured and relevant data
- Prompts should guide AI behavior and enforce business rules
This step is critical because poorly designed components can lead to unpredictable AI behavior.
4. Build API Endpoints
Create endpoints that allow AI agents to interact with your MCP server. Common endpoints include:
- /tools for listing available actions
- /resources for accessing data
- /execute for triggering workflows
Ensure that these endpoints are secure, well-documented, and version-controlled.
5. Connect to MCP SQL Server
Use a database layer to store structured data, manage queries, and maintain context. This is especially important for workflows that require state management or historical tracking.
6. Implement Security and Logging
Security is a critical aspect of MCP architecture. Implement:
- Role-based access control
- Scoped permissions for tools
- Audit logging for all actions
- Error tracking and monitoring
This ensures that AI agents operate within defined boundaries.
Why Procore Integrations Are Painful Today
This challenge is not unique to construction or Procore. In MuleSoft’s 2025 Connectivity Benchmark Report, 95% of IT leaders said integration is a hurdle to implementing AI effectively, highlighting how fragmented systems and maintenance-heavy integrations continue to slow modern software teams.
Construction platforms like Procore present unique integration challenges. These systems often involve multiple APIs, complex data relationships, and frequent schema updates.
Typical Procore integrations require:
- Webhook handling for real-time updates
- Retry mechanisms for failed requests
- Data transformation between systems
- Custom scripts for error handling
As more systems are added, the integration layer becomes increasingly complex. Maintenance overhead grows, and small changes can break entire workflows.
This is where MCP provides a significant advantage by centralizing capabilities and enabling dynamic orchestration.
Mapping MCP to Procore API
Mapping MCP primitives to Procore developer API endpoints allows developers to create flexible and intelligent integrations.
MCP Tools mapped to Procore Actions
Tools can represent actions such as creating a project, updating a commitment, or approving a change order.
MCP Resources mapped to Procore Data
Resources can expose project data, financial records, and change order details.
MCP Prompts mapped to Workflow Logic
Prompts can define rules such as triggering approvals when costs exceed a threshold or synchronizing data across systems.
This mapping transforms rigid integrations into adaptive, AI-driven workflows.
Real Example: Procore MCP Integration
Consider a scenario where an organization wants to expose Procore data to an AI assistant.
Use Case
The MCP server enables AI agents to fetch project details, analyze commitments, and manage change orders dynamically.
Step 1: Authentication
Configure secure access to the Procore API using OAuth and API credentials.
Step 2: Integration Layer
Build services that interact with Procore endpoints for projects, commitments, and change orders.
Step 3: Resource Exposure
Expose structured resources such as:
- Projects
- Commitments
- Change orders
Step 4: Tool Execution
Define tools that allow the AI agent to perform actions such as updating records or triggering approvals.
This approach allows the AI to make context-aware decisions instead of relying on predefined workflows.
Code Example: How to Create MCP Server in Python
import os
import requests
from fastapi import FastAPI
app = FastAPI()
PROCORE_API = "https://api.procore.com/rest/v1.0"
@app.get("/projects")
def get_projects(company_id: int):
response = requests.get(
f"{PROCORE_API}/projects",
params={"company_id": company_id},
headers={"Authorization": f"Bearer {os.environ['PROCORE_TOKEN']}"},
)
response.raise_for_status()
return response.json()
This example demonstrates how to create a simple endpoint that fetches project data. In a production environment, this would include authentication, error handling, and logging mechanisms.
Real Deployment Scenario
On one client project, this pattern replaced 63 active Zapier workflows connecting Procore to other business systems with 8 MCP tools covering the same ground, with structured permissions and AI-native design built in from the start.
In real-world deployments, MCP reduces workflow sprawl and simplifies integration management. Instead of maintaining dozens of automation scripts, teams can rely on centralized tools and AI-driven orchestration.
Best Practices
- Use scoped permissions to limit access
- Implement comprehensive audit logging
- Secure all API interactions
- Monitor AI decisions and outcomes
- Avoid exposing unnecessary tools or data
When to Use MCP (and When Not To)
Use MCP when:
- Workflows require AI reasoning
- Multiple tools need to be orchestrated dynamically
- Systems are highly fragmented
Avoid MCP when:
- Workflows are simple and deterministic
- Traditional APIs already solve the problem
- Performance and predictability are critical
Frequently Asked Questions
Is MCP production-ready?
MCP is still evolving, but it is already being used in experimental and early production environments.
Can MCP replace all integrations?
No. MCP is best suited for complex, dynamic workflows. Simple integrations are often better handled with traditional APIs.
How to create MCP server in Python?
To create an MCP server in Python, developers typically start by choosing a framework such as FastAPI, defining MCP tools, resources, and prompts, and then exposing secure endpoints for execution. In most cases, the process includes authentication, logging, and integrations with external APIs such as Procore.
How to build MCP server from scratch?
To build an MCP server from scratch, begin by defining the use case, selecting the development stack, designing MCP components, creating API endpoints, connecting a database layer, and implementing security controls. A modular architecture helps ensure the MCP server remains scalable and maintainable as integrations grow.
What is an MCP server?
An MCP server is a system that exposes tools, resources, and prompts, allowing AI agents to interact with external systems in a structured way.
How is MCP different from REST APIs?
REST APIs require predefined interactions, while MCP allows AI agents to dynamically choose actions based on context.
Final Thoughts
Building an MCP server represents a shift toward AI-native integration architecture. It allows organizations to move beyond rigid, hardcoded integrations and adopt a more flexible, scalable approach.
However, the goal is not to replace every integration with MCP. The real value comes from applying it where it makes sense: in environments where workflows are complex, systems are fragmented, and AI can provide meaningful orchestration.
By combining MCP architecture with real-world integrations like the Procore API developers can build intelligent systems that are more resilient, adaptable, and future-ready.



