How to Build an MCP Server for Your Business in Under 1 Hour (With Claude API)
Step-by-step tutorial: Build a custom MCP server for your business using Python and Claude API in under 1 hour. Connect Claude to your own data and tools.
Yesterday we explained what MCP (Model Context Protocol) is and why it matters. Today we are going to build something.
By the end of this tutorial, you will have a working MCP server that gives Claude access to a custom tool — a business document reader that can answer questions about any CSV data file you point it at. The same pattern applies to connecting Claude to your database, your product catalog, your customer records, or any structured data your business holds.
PREREQUISITES
Python 3.11+ • Basic command line familiarity • Claude API key from console.anthropic.com
Total time: approximately 45 to 60 minutes
Let us build it. 🚀
Install the MCP Python SDK
Anthropic provides an official Python SDK for building MCP servers. It handles all the protocol-level communication so you can focus on defining what your tools do.
Install Dependencies
# Install required packages pip install anthropic mcp pandas # Verify installation python -c "import mcp; print('MCP SDK ready')"
Create Your MCP Server File
We will build a CSV Data Analyst server. It exposes two tools to Claude: one to list available data files, and one to run a natural-language query against any CSV file.
mcp_server.py — Full Server Code
import asyncio import pandas as pd import anthropic from pathlib import Path from mcp.server import Server from mcp.server.stdio import stdio_server from mcp import types # Initialize server app = Server('csv-analyst-server') DATA_FOLDER = Path('./data') DATA_FOLDER.mkdir(exist_ok=True) @app.list_tools() async def list_tools() -> list[types.Tool]: return [ types.Tool( name='list_data_files', description='List all available CSV data files in the data folder.', inputSchema={'type': 'object', 'properties': {}, 'required': []} ), types.Tool( name='query_csv', description='Answer a question about a CSV file using data analysis.', inputSchema={ 'type': 'object', 'properties': { 'filename': {'type': 'string', 'description': 'Name of the CSV file'}, 'question': {'type': 'string', 'description': 'Question to answer about the data'} }, 'required': ['filename', 'question'] } ) ] @app.call_tool() async def call_tool(name: str, arguments: dict) -> list[types.TextContent]: if name == 'list_data_files': files = list(DATA_FOLDER.glob('*.csv')) if not files: return [types.TextContent(type='text', text='No CSV files found.')] file_list = '\n'.join([f.name for f in files]) return [types.TextContent(type='text', text=f'Available files:\n{file_list}')] elif name == 'query_csv': filepath = DATA_FOLDER / arguments['filename'] if not filepath.exists(): return [types.TextContent(type='text', text=f'File not found: {arguments["filename"]}')] df = pd.read_csv(filepath) summary = f"""File: {arguments['filename']} Rows: {len(df)} | Columns: {list(df.columns)} Sample: {df.head().to_string()} Stats: {df.describe().to_string()}""" client = anthropic.Anthropic() response = client.messages.create( model='claude-sonnet-4-20250514', max_tokens=500, messages=[{'role': 'user', 'content': f'Data:\n{summary}\nAnswer: {arguments["question"]}'}] ) answer = response.content[0].text return [types.TextContent(type='text', text=answer)] return [types.TextContent(type='text', text='Unknown tool')] async def main(): async with stdio_server() as (read_stream, write_stream): await app.run(read_stream, write_stream, app.create_initialization_options()) if __name__ == '__main__': asyncio.run(main())
Add Sample Data and Test
Create a data folder and add a sample CSV to test with.
Create Sample Data
import pandas as pd import os os.makedirs('data', exist_ok=True) # Create sample sales data df = pd.DataFrame({ 'month': ['Jan','Feb','Mar','Apr','May','Jun'], 'revenue_usd': [45000,52000,48000,61000,58000,73000], 'customers': [120,145,133,178,162,201], 'product': ['Course','Course','Course', 'Course+Consulting','Course','Course+Consulting'] }) df.to_csv('data/sales_2026.csv', index=False) print('Sample data created: data/sales_2026.csv')
Connect to Claude Desktop or Your Agent
Add the server to your Claude Desktop config file. Paths by OS:
| OPERATING SYSTEM | CONFIG FILE PATH |
|---|---|
| 🍎 macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| 🪟 Windows | %APPDATA%\Claude\claude_desktop_config.json |
Claude Desktop Config
{ "mcpServers": { "csv-analyst": { "command": "python", "args": ["/full/path/to/your/mcp_server.py"], "env": { "ANTHROPIC_API_KEY": "your-api-key-here" } } } }
Test Your Server
Restart Claude Desktop after saving the config. The CSV Analyst server will appear in the tools panel. Try:
"What were our highest revenue months according to sales_2026.csv?"
"How many customers did we acquire in Q1?"
HOW IT WORKS BEHIND THE SCENES
Claude receives your question and decides to call the query_csv tool
Your MCP server reads the CSV, generates a data summary, and queries Claude API
Claude returns an intelligent answer — no prompt templates or hardcoded responses needed
Extending This to Real Business Use Cases
The pattern you just built applies directly to real business scenarios. Replace the CSV reader and you unlock entirely different capabilities:
🗄️
Database Connection
Use SQLAlchemy to give Claude a natural-language interface to your entire business database.
📝
Notion API
Connect to Notion so Claude can read and write your company's entire knowledge base.
👥
CRM Integration
Connect your CRM API so Claude can pull real-time customer history on demand.
PRO TIP
Every tool you expose through MCP becomes a capability Claude can use autonomously. Start with one tool, test it thoroughly, then add more. Most production MCP servers expose between 5 and 15 tools.
NEXT IN THE MCP SERIES
Building a Gmail MCP Integration That Lets Claude Read, Classify & Respond to Emails Autonomously
The most commonly requested enterprise use case from AiBytec students — coming next.
Conclusion
You just built and deployed a custom MCP server. That puts you ahead of the vast majority of developers who have heard of MCP but never actually built one.
The fundamentals you used here — defining tools with schemas, handling tool calls, returning structured responses — are the same fundamentals used in production MCP servers connecting to databases, cloud storage, and enterprise software. Scale from here.
🎓
Ready to Go Deeper?
Join our Generative AI Batch 4 and learn to build production-grade Agentic AI systems step by step — with live mentorship from industry practitioners.
Enroll at AiBytec.com →✅ Found this helpful? Share on LinkedIn and tag someone who needs to see it.
Follow AiBytec.com for daily AI tutorials, tool reviews, and agent-building guides.

