Start by reading the documentation - https://modelcontextprotocol.io/introduction
Then use FastMCP to write an MCP server in Python - https://github.com/jlowin/fastmcp
Finally, hook it up to an LLM client. It’s dead simple to do in Claude Code, create an .mcp.json file and define the server’s startup command.