Skip to content

Commit 9859e49

Browse files
committed
v0.2.0
1 parent a33a5b8 commit 9859e49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1872
-949
lines changed

.github/workflows/reusable-pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ jobs:
4040
4141
- name: Run pytest with --clean
4242
working-directory: ./test/server
43-
run: pytest --clean
43+
run: bash run.sh a --clean

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,27 @@ docker/data/
4545
docker_dev/
4646
specification/
4747
.windsurfrules
48+
.windsurf/
4849
kill.sh
4950
.pytest_cache/
5051
.vscode/
5152
.input
5253
payload.json
54+
.tmp/
5355
*.original
5456
*.old
5557
*.backup
5658
*.backups
5759
.*/ # ignore all dot-directories
5860
!.github/ # but do NOT ignore .github directory
5961

62+
63+
6064
# Tests
6165
test/server-stress-tests/
6266
test/mcpServer-compatibility/
6367

6468

6569
# Src
6670
src/webui/
71+
src/__*

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# MCPOSimpleServer
1+
# MCPoSimpleServer
22

33
A Python-based LLM server that implements the Model Context Protocol (MCP).
44

5-
## 🤔 What is MCPOSimpleServer?
5+
## 🤔 What is MCPoSimpleServer?
66

7-
MCPOSimpleServer is a lightweight, asynchronous API platform for running and managing MCP tools in isolated, secure environments. It implements the Model Context Protocol (MCP) for seamless integration with LLM applications.
7+
MCPoSimpleServer is a lightweight, asynchronous API platform for running and managing MCP tools in isolated, secure environments. It implements the Model Context Protocol (MCP) for seamless integration with LLM applications.
88

99
## 📺 Demo
1010

11-
Check out our demo video to see SimpleTool Server in action:
11+
Check out our demo video to see MCPoSimpleServer in action:
1212

13-
[![SimpleTool Server Demo](https://img.youtube.com/vi/tQ6OhvC4eDQ/0.jpg)](https://www.youtube.com/watch?v=tQ6OhvC4eDQ)
13+
[![MCPoSimpleServer Demo](https://img.youtube.com/vi/tQ6OhvC4eDQ/0.jpg)](https://www.youtube.com/watch?v=tQ6OhvC4eDQ)
1414

1515
## ✨ Key Features
1616

docker/Dockerfile

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
FROM debian:trixie
22

33
LABEL MAINTAINER="Artur Zdolinski artur@zdolinski.com"
4-
ARG TZ=Etc/UTC
5-
ARG APP_VERSION=0.0.0
4+
ARG TZ
65
ARG USER=appuser
76
ARG UID=1000
87
ARG GID=100
9-
8+
ARG APP_FOLDER=/app/mcpo_simple_server
109

1110
USER root
1211
### Envrionment config
@@ -26,10 +25,10 @@ ENV DISPLAY=:1 \
2625
TERM=xterm \
2726
STARTUPDIR=/dockerstartup \
2827
DEBIAN_FRONTEND=noninteractive \
29-
APP_FOLDER=/app \
30-
NODE_VERSION=v23.6.0 \
28+
APP_FOLDER=${APP_FOLDER} \
3129
SSHD_ENABLED=true \
32-
SSHD_PORT=22
30+
SSHD_PORT=22 \
31+
TZ=Etc/UTC
3332

3433
WORKDIR /tmp
3534

@@ -54,6 +53,7 @@ RUN apt-get update && \
5453
apt-utils \
5554
iputils-ping \
5655
psmisc \
56+
tzdata \
5757
ttf-wqy-zenhei \
5858
fonts-liberation \
5959
python3-dotenv \
@@ -62,10 +62,11 @@ RUN apt-get update && \
6262
python3-venv \
6363
python3-dev \
6464
python3-numpy \
65+
python-is-python3 \
6566
npm \
6667
openssh-server \
6768
&& apt-get clean -y \
68-
&& rm -rf /var/lib/apt/lists/*
69+
&& rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
6970

7071
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
7172
RUN useradd -m -s /bin/bash -N -u $UID -g $GID $USER \
@@ -99,23 +100,23 @@ RUN apt-get update \
99100
libdbus-glib-1-2 \
100101
&& apt-get purge -y pm-utils *screensaver* \
101102
&& apt-get clean -y \
102-
&& rm -rf /var/lib/apt/lists/*
103+
&& rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
103104

104105
### Install chromium
105106
RUN apt-get update \
106107
&& apt-get install -y --no-install-recommends \
107108
chromium \
108109
&& ln -sfn /usr/bin/chromium /usr/bin/chromium-browser \
109110
&& apt-get clean -y \
110-
&& rm -rf /var/lib/apt/lists/*
111+
&& rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
111112

112113
### Install xvnc-server & noVNC - HTML5 based VNC viewer
113114
RUN apt-get update \
114115
&& apt-get install -y \
115116
tigervnc-standalone-server \
116117
tigervnc-common \
117118
&& apt-get clean -y \
118-
&& rm -rf /var/lib/apt/lists/*
119+
&& rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
119120

120121
RUN printf '\n# mcpo-simple-server-desktop-xfce4:\n$localhost = "no";\n1;\n' >>/etc/tigervnc/vncserver-config-defaults \
121122
&& mkdir -p $NO_VNC_HOME/utils/websockify \
@@ -130,29 +131,32 @@ RUN for f in /usr/lib/python3*/EXTERNALLY-MANAGED; do \
130131

131132
### Install nvm
132133
RUN wget -qO- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash && \
133-
/bin/bash -c "source $HOME/.nvm/nvm.sh && nvm install $NODE_VERSION && nvm use --delete-prefix $NODE_VERSION"
134+
/bin/bash -c "source $HOME/.nvm/nvm.sh && nvm install stable && nvm use stable" \
135+
&& chown -R $USER:$GID $HOME/.nvm
134136

135137
### Install python uvx
136138
RUN PIP_BREAK_SYSTEM_PACKAGES=1 python3 -m pip install uvx && \
137139
pip3 install setuptools
138140

139141
# Switch to user
140142
USER appuser
141-
ENV PATH="/home/appuser/.local/bin:${PATH}" \
142-
APP_VERSION=${APP_VERSION}
143143
ADD --chown=$USER:$GID ./docker/src/home/ $HOME/
144144
ADD ./docker/src/startup/ $STARTUPDIR
145-
RUN mkdir -p /app/mcpo_simple_server \
145+
RUN mkdir -p ${APP_FOLDER} \
146146
&& chmod +x $HOME/wm_startup.sh \
147147
&& touch $HOME/.bashrc
148148

149149
WORKDIR /home/appuser
150150

151151
### Install MCPoSimpleServer
152-
ADD --chown=$USER:$GID ./src/mcpo_simple_server /app/mcpo_simple_server/
153-
RUN rm -rf /app/mcpo_simple_server/data/config \
154-
&& rm -rf /app/mcpo_simple_server/.env \
155-
&& sudo pip3 install -r /app/mcpo_simple_server/requirements.txt
152+
ADD --chown=$USER:$GID ./src/mcpo_simple_server ${APP_FOLDER}/
153+
ARG APP_VERSION
154+
RUN rm -rf ${APP_FOLDER}/data/config \
155+
&& rm -rf ${APP_FOLDER}/.env \
156+
&& sudo pip3 install -r ${APP_FOLDER}/requirements.txt \
157+
&& if [ ! -z "${APP_VERSION}" ]; then \
158+
echo "__version__ = \"${APP_VERSION}\"" > ${APP_FOLDER}/_version.py; \
159+
fi
156160

157161
# Use supervisord to manage both VNC and Uvicorn
158162
COPY ./docker/src/supervisor/conf.d/* /etc/supervisor/conf.d/

docker/docker-compose.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ services:
77
#build:
88
# context: ..
99
# dockerfile: ./docker/Dockerfile
10+
# args:
11+
# - APP_VERSION=${APP_VERSION:-0.0.0}
1012
ports:
1113
- 2222:22 # SSH port
1214
- 8000:8000 # API HTTP MCPoSimpleServer port
@@ -28,12 +30,12 @@ services:
2830

2931
networks:
3032
default:
31-
name: simpletool
33+
name: mcpo-simple-server
3234

3335
# Create volume for data
3436
volumes:
3537
data:
36-
name: simpletool-server-data
38+
name: mcpo-simple-server-data
3739
driver_opts:
3840
type: none
3941
o: bind

src/mcpo_simple_server/__main__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
import sys
77
import argparse
88
import uvicorn
9-
from loguru import logger
10-
from mcpo_simple_server.main import fastapi
9+
from mcpo_simple_server.logger import logger
1110

1211

1312
def parse_args():

src/mcpo_simple_server/_version.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
"""Version information."""
2-
3-
__version__ = "0.1.0"
1+
__version__ = "0.13.0"

src/mcpo_simple_server/config.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,30 @@
55
"""
66
import os
77
import pathlib
8-
9-
# Import version from central location
8+
from mcpo_simple_server.logger import logger
109
from mcpo_simple_server._version import __version__
1110

1211
# Define application paths
1312
APP_PATH = pathlib.Path(os.getcwd())
14-
APP_VERSION = os.getenv("APP_VERSION", __version__)
13+
APP_VERSION = str(__version__)
1514
APP_NAME = "MCPoSimpleServer"
1615
CONFIG_STORAGE_TYPE = os.getenv("CONFIG_STORAGE_TYPE", "files")
1716
CONFIG_STORAGE_PATH = os.getenv("CONFIG_STORAGE_PATH", str(APP_PATH / "data" / "config"))
1817

18+
1919
# If the path points to a file (config.json), extract the directory path
2020
if CONFIG_STORAGE_PATH.endswith(".json"):
2121
CONFIG_MAIN_FILE_PATH = CONFIG_STORAGE_PATH
2222
CONFIG_STORAGE_PATH = os.path.dirname(CONFIG_STORAGE_PATH)
2323
else:
2424
# If it's already a directory, append config.json for the file path
2525
CONFIG_MAIN_FILE_PATH = os.path.join(CONFIG_STORAGE_PATH, "config.json")
26+
27+
28+
# Create the config directory if it doesn't exist
29+
try:
30+
if not os.path.exists(CONFIG_STORAGE_PATH):
31+
os.makedirs(CONFIG_STORAGE_PATH)
32+
logger.info(f"📁 Config directory created: {CONFIG_STORAGE_PATH}")
33+
except Exception as e:
34+
logger.error(f"Failed to create config directory at {CONFIG_STORAGE_PATH}: {str(e)}")

src/mcpo_simple_server/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from typing import Any
66
from mcpo_simple_server.logger import logger
77
from mcpo_simple_server.config import CONFIG_MAIN_FILE_PATH, APP_VERSION, APP_NAME
8-
import mcpo_simple_server.routers.prompts as prompts_module
98
import mcpo_simple_server.routers.admin as admin_module
9+
import mcpo_simple_server.routers.public as public_module
1010
import mcpo_simple_server.routers.mcp_sse as mcp_sse_module
1111
import mcpo_simple_server.routers.tools as tools_module
1212
import mcpo_simple_server.routers.user as user_module
@@ -42,9 +42,9 @@
4242

4343
# Include routers
4444
fastapi.include_router(user_module.router)
45-
fastapi.include_router(mcp_sse_module.router) # Include the SSE transport router
46-
fastapi.include_router(prompts_module.router)
45+
fastapi.include_router(public_module.router)
4746
fastapi.include_router(admin_module.router)
47+
fastapi.include_router(mcp_sse_module.router) # Include the SSE transport router
4848

4949

5050
def custom_openapi():

src/mcpo_simple_server/routers/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"""
66

77
# Define what should be exported from this package
8-
__all__ = ['admin_router', 'tools_router', 'user_router', 'mcp_sse_router']
8+
__all__ = ['admin_router', 'tools_router', 'public_router', 'mcp_sse_router']
99

1010
# Import the router modules directly
1111
from .admin import router as admin_router
1212
from .tools import router as tools_router
13-
from .user import router as user_router
13+
from .public import router as public_router
1414
from .mcp_sse import router as mcp_sse_router

0 commit comments

Comments
 (0)