Add Mcp to Llamacpp by Fastmcp
Install python FastMCP package
create an MCP server
See Quick start
Notice
- Add the allowed urls in the fastMCP class initializing line to limit the allowed urls.*
Start the MCP server
python mcp.py
Start Llama.cpp with the MCP command argument
Llama.cpp -m model -ui-mcp-proxy
Finally in the web ui, add the map url that shows in the command line with “/sse” added to the url end and toggle the button of ‘using mcp proxy’ in the web ui.
Installing Python Dependencies
Recenlty when using conda to create an environment, I used a script that was written about three months ago. At that time, I ran the code to install the python dependencies and it worked fine on my Kaggle notbook. But when I tried to run it again yesterday, it reported error after searching a specific package ( in this case it’s Cython version mismatch when installing a version of murmurhash).
I copied the code to run on my computer it still reported the error under my linux operation system. So it is obvious that some python packages may change dependencies relations, even when the packages are associated with certain earlier python version (python3.6 for example). Same scripts that successfully created and built an environment long time targeting a python version also long time ago may not always work in the long run. So the best practice may be creating an an environment and never recreating it after successfully installing the necessary dependencies. So Never transplanting or gliding the lily.
Anaconda proxy setting
This is what recently has been searched several times. For future reference, it could be noted here.
conda config --set proxy_servers.http http://localhost:XXXXX
conda ocnfig --set proxy_servers.https http://localhost:XXXXX
other basic conda commands
# creating new environment
conda create -n new_envrionment_name python=3.XX --yes
# list environments
conda env list
# delete an environment
conda remove -n environment_name --all
# activate an environment
conda activate new_envrionment_name
# or using path to create and activate new environments
conda create -p path/to/new/environment
conda activate path/to/new/environment