https://github.com/nshkrdotcom/mcp_client
Full-featured Elixir client for the Model Context Protocol (MCP) with multi-transport support, resources, prompts, tools, and telemetry.
https://github.com/nshkrdotcom/mcp_client
ai-agent ai-tooling api-client beam elixir genserver http jsonrpc llm llm-infrastructure mcp model-context-protocol observability otp prompt-engineering resource-management sdk sse stdio telemetry
Last synced: about 2 months ago
JSON representation
Full-featured Elixir client for the Model Context Protocol (MCP) with multi-transport support, resources, prompts, tools, and telemetry.
- Host: GitHub
- URL: https://github.com/nshkrdotcom/mcp_client
- Owner: nshkrdotcom
- License: mit
- Created: 2025-11-06T23:24:27.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2025-11-07T05:43:32.000Z (2 months ago)
- Last Synced: 2025-11-07T07:19:54.038Z (2 months ago)
- Topics: ai-agent, ai-tooling, api-client, beam, elixir, genserver, http, jsonrpc, llm, llm-infrastructure, mcp, model-context-protocol, observability, otp, prompt-engineering, resource-management, sdk, sse, stdio, telemetry
- Language: Elixir
- Homepage: https://nshkr.com
- Size: 156 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MCP Client for Elixir
[](https://elixir-lang.org)
[](https://www.erlang.org)
[](https://hex.pm/packages/mcp_client)
[](https://hexdocs.pm/mcp_client)
[](LICENSE)
> Canonical Model Context Protocol client for the Elixir ecosystem with first-class transports, tooling, and documentation.
## โจ Highlights
- **Unified transports**: WebSocket, SSE, and raw TCP adapters with shared backoff + tombstone semantics
- **Declarative tools**: Type-safe wrappers for tool declaration, invocation, and validation
- **Observability-first**: Telemetry events for every hop plus structured, redactable logging helpers
- **Production ergonomics**: Configurable retry windows, circuit breakers, and connection watchdogs
- **Docs as product**: ExDoc assets, architecture guides, and SVG branding ship with the library
## ๐ฆ Installation
Add `mcp_client` to your `mix.exs` dependencies:
```elixir
def deps do
[
{:mcp_client, "~> 0.1.0"}
]
end
```
Then fetch dependencies:
```bash
mix deps.get
```
## ๐ Quick Start
1. Configure your MCP server credentials in `config/runtime.exs`
2. Start a connection with `McpClient.start_link/1`
3. Declare tools with `McpClient.Tools.declare/1` and register handlers
4. Stream responses with built-in supervision, telemetry, and retries
Full guides and API docs will be published on HexDocs as the project matures.
## ๐งช Development
```bash
mix test
mix credo --strict
MIX_ENV=test mix coveralls.html
```
Dialyzer PLTs live in `priv/plts` (ignored in the Hex package) so shared CI nodes stay fast.
## ๐ค Contributing
Issues and PRs are welcome! Please open a discussion first for sizeable protocol or API changes so we can align on design.