About mcp-server-demo
mcp-server-demo shows a setup and usage flow for MCP tools with LibreChat, Ollama, and local MongoDB. Its example tools retrieve local and external IPv4 and IPv6 addresses.
Key features
- 01Tools for local and external IP lookup
- 02Includes a LibreChat configuration example
- 03Create an agent using an Ollama model
Use cases
- 01Test IP lookup tools in LibreChat
- 02Ask an agent for local or external IP addresses
MCP support
The example configures an SSE MCP server in LibreChat so an agent can call tools that retrieve local and external IP addresses.
Configuration
Remote servers need no local install. Pick your client, then copy the config or install in one click.
http://localhost:3000/sseclaude mcp add --transport http demo-dev-johnny-gh http://localhost:3000/sse{"mcpServers":{"demo-dev-johnny-gh":{"type":"http","url":"http://localhost:3000/sse"}}}Open in Cursor{"servers":{"demo-dev-johnny-gh":{"type":"http","url":"http://localhost:3000/sse"}}}Open in VS Code{"mcpServers":{"demo-dev-johnny-gh":{"type":"http","url":"http://localhost:3000/sse"}}}{"mcpServers":{"demo-dev-johnny-gh":{"serverUrl":"http://localhost:3000/sse"}}}Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.
Tools
Details
From the project READMEInstallation
-
cd IpServer && npm install && npm run build && npm run start
-
install a local mongodb server and serve it on mongodb://127.0.0.1:27017
-
cd LibreChat && git clone [email protected]:danny-avila/LibreChat.git && mv .env.example .env && npm install && npm run frontend && npm run backend
-
add following configuration to your librechat.yaml file:
mcpServers:
ipServer:
# type: sse # type can optionally be omitted
url: http://localhost:3000/sse
timeout: 60000 # 1 minute timeout for this server, this is the default timeout for MCP servers.
endpoints:
custom:
- name: "Ollama"
apiKey: "ollama"
# use 'host.docker.internal' instead of localhost if running LibreChat in a docker container
baseURL: "http://localhost:11434/v1/chat/completions"
models:
default:
[
"qwen2.5:3b-instruct-q4_K_M",
"mistral:7b-instruct-q4_K_M",
"gemma:7b-instruct-q4_K_M",
]
# fetching list of models is supported but the `name` field must start
# with `ollama` (case-insensitive), as it does in this example.
fetch: true
titleConvo: true
titleModel: "current_model"
summarize: false
summaryModel: "current_model"
forcePrompt: false
modelDisplayLabel: "Ollama"
- download and run ollama, download a model from https://ollama.ai/models/ and serve ollama on http://localhost:11434/
Usage
-
Visit http://localhost:3080/ to see the LibreChat UI.
-
Create a new agent with the name "Ollama" and select the ollama as the model provider and select a model
-
Click on the Add Tools button below and add the get-external-ip, get-local-ip-v6, get-external-ip-v6, get-local-ip tools
-
Ask agent what's my local ip address? / what's my external ip address? / what's my external ipv6 address? / what's my internal ipv6 address?
-
Agent should invoke your tools and return the results.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.