Chapter 19 · Hands-on: build real projects
Connect your MCP server to an AI app
An AI app that supports MCP reads a config entry, starts your server and lists its tools for the model to use.
Chapter 19 · Hands-on: build real projects
An AI app that supports MCP reads a config entry, starts your server and lists its tools for the model to use.
A few lines of config say where your server is…
An MCP-capable AI app keeps a small settings entry for each server: a name, a command to start it and its arguments. At launch the app runs that command, asks the server what tools it has and offers them to the model.
You built a server in Build a simple MCP server and tested it with your own client. Now a real AI app will be the client. The app does the same handshake your test script did, but the model decides when to call the tools.
You need an AI app that supports MCP servers on your computer. Many chat and coding apps do; check your app’s own documentation for “MCP” or “tools” settings. These steps stay general because each app names things a little differently.
Apps start your server from their own folder, not yours, so short names like python often fail. You need full paths. First, move into mcp-notes and activate its virtual environment. Then ask Python where it lives.
cd mcp-notes
.venv\Scripts\Activate.ps1
python -c "import sys; print(sys.executable)" Check: It prints a long path that ends in python (or python.exe) and contains .venv. Copy it.
Still inside mcp-notes, print the current folder with pwd (it works on Windows PowerShell, macOS and Linux). Then add notes_server.py to the end of it, with the separator your system uses (/ on Mac and Linux, \ on Windows).
pwd Check: For example /home/you/mcp-notes becomes /home/you/mcp-notes/notes_server.py. Your server finds the notes folder next to itself, so it works from anywhere.
Use the builder below this tutorial. Type your two paths and a name; it writes the JSON. JSON is a strict text format: every quote, comma and bracket matters, and Windows paths need doubled backslashes, which the builder does for you.
Check: The builder shows “Looks good” and a JSON block with mcpServers, your name, a command and args.
Open your AI app’s settings and look for a section named something like MCP, tools, developer or integrations. Most apps either have an “add server” form or a button that opens their config file. Paste in the entry. If the file already has content, paste your current text into the builder’s optional box so it merges for you instead of overwriting.
Check: The file is saved and still valid JSON. Many editors underline errors.
Most apps read their MCP settings only when they start. Quit the app fully (check the system tray or menu bar, not just the window), then open it again.
Check: The app shows your notes server and its three tools somewhere, often as a small tools or plug icon. A red or error state means start with the troubleshooter below.
Ask the model something that needs your notes, for example: “Search my notes for lunch.” The app should ask your permission before it calls the tool, since the tool runs on your computer. Approve it once and read what the tool returned.
Check: The answer quotes the lunch line from canteen.md, and the app shows that it called search_notes.
Paste your two full paths. Add your current config too if you have one, and it will merge instead of replace. Text only; nothing runs.
{
"mcpServers": {
"notes": {
"command": "/home/you/mcp-notes/.venv/bin/python",
"args": [
"/home/you/mcp-notes/notes_server.py"
]
}
}
}Everything stays on this page. Windows backslashes are escaped for you, as JSON needs.
What do you see?
Why does the config use full paths?
You edited the config but nothing changed. What should you try?
Why should you be careful what MCP servers you connect?