# Building a MCP Server in Elixir

DevFeed: [Building a MCP Server in Elixir](<https://devfeed.tech/articles/building-a-mcp-server-in-elixir-20112.md>)

Original publisher: [Read original article](<https://hashrocket.com/blog/posts/building-a-mcp-server-in-elixir>)

Author: Vinicius Negrisolo

Published: 2025-11-25T14:00:00Z

Content type: tutorial

Language: en

Sources: [Hashrocket](<https://devfeed.tech/sources/hashrocket.md>)

Topics: [MCP Server](<https://devfeed.tech/topics/mcp-server.md>), [Model Context Protocol](<https://devfeed.tech/topics/model-context-protocol.md>), [Elixir](<https://devfeed.tech/topics/elixir.md>), [API](<https://devfeed.tech/topics/api.md>), [Tool](<https://devfeed.tech/topics/tool.md>), [Documentation](<https://devfeed.tech/topics/documentation.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [api](<https://devfeed.tech/tags/api.md>), [building](<https://devfeed.tech/tags/building.md>), [development](<https://devfeed.tech/tags/development.md>), [documentation](<https://devfeed.tech/tags/documentation.md>), [elixir](<https://devfeed.tech/tags/elixir.md>), [mcp](<https://devfeed.tech/tags/mcp.md>), [mcp-server](<https://devfeed.tech/tags/mcp-server.md>), [model-context-protocol](<https://devfeed.tech/tags/model-context-protocol.md>), [process](<https://devfeed.tech/tags/process.md>), [tool](<https://devfeed.tech/tags/tool.md>)

## AI overview

A practical guide to building an MCP server in Elixir for a TIL website. The project uses Anubis to expose a tool that creates TIL posts from AI tooling, with detailed tool and input descriptions to help the AI map requests to the expected schema.

## Source excerpt

We've been working with MCP servers for a while, and this use case was a perfect opportunity to build out another one. What is an MCP Server? A very simple way to put it is that Model Context Protocol is an "API" that your AI tooling can use to get external data or perform actions by interacting with your application. If it's just an API, that seems very easy to implement. Let's think about our use case then. The Use Case The project is the TIL https://til.hashrocket.com/ website where we developers usually write about our own learning experiences throughout small TIL posts. So our idea with the MCP server was to provide a way to simply create a TIL post from inside our AI tooling, and then maybe go to the TIL site and refine that idea. These days we spend a lot of time inside our AI tools asking the most variety of questions, and we end up learning something from those interactions. Eventually, if we learn from an AI chat interaction, we'd like to just grab that content and maybe scaffold it into a new TIL post. This was the starting point of the project, and with that we started to take a look into libraries to achieve that. We found out that there were 2 libraries that were both forks of each other: Hermes MCP Anubis MCP We played around a bit with Hermes but we ended up using Anubis in the end. I have to say it was a bit of a bumpy road. The documentation for both was not the best - we had some situations where the documentation was outdated or just simply not working - so follow our steps here if you want to setup an MCP server yourself. MCP Server The first component to write is an MCP server, which is very simple. For now it's just: defmodule Tilex.MCP.Server do use Anubis.Server, name: "TIL", version: "1.0.0", capabilities: [:tools] component(Tilex.MCP.NewPost) end MCP Tools So the first tool we made was to create a TIL Post: defmodule Tilex.MCP.NewPost do @moduledoc """ Create a new TIL ("Today I Learned") post. TIL is a place for sharing something you've l