A lightweight reference implementation that demonstrates MCP server patterns in Python. It exposes a single `random_float` tool that returns a random number between 0 and 1, which makes it most useful as a starting point for building your own MCP servers rather than a production integration. Supports STDIO, HTTP, and SSE transports out of the box, with Docker packaging included. The codebase is minimal and well-documented with examples for local development and Claude Desktop integration. Reach for this when you need a working template to understand MCP server architecture or want to prototype a custom tool without framework overhead.
��#� �S�i�m�p�l�e� �M�C�P� �S�e�r�v�e�r� �(�P�y�t�h�o�n�)�
�
�
�
�T�h�i�s� �p�r�o�j�e�c�t� �p�r�o�v�i�d�e�s� �a� �m�i�n�i�m�a�l� �M�o�d�e�l� �C�o�n�t�e�x�t� �P�r�o�t�o�c�o�l� �(�M�C�P�)� �s�e�r�v�e�r� �u�s�i�n�g� �P�y�t�h�o�n�.� �I�t� �e�x�p�o�s�e�s� �a� �s�i�n�g�l�e� �t�o�o�l� ��r�a�n�d�o�m�_�f�l�o�a�t�� �t�h�a�t� �r�e�t�u�r�n�s� �a� �r�a�n�d�o�m� �f�l�o�a�t� �i�n� �[�0�,�1�)�.� �T�h�e� �s�e�r�v�e�r� �s�u�p�p�o�r�t�s� �m�u�l�t�i�p�l�e� �t�r�a�n�s�p�o�r�t� �m�o�d�e�s�:� �S�T�D�I�O� �(�d�e�f�a�u�l�t�)�,� �H�T�T�P�,� �a�n�d� �S�S�E�.�
�
�
�
�#�#� �R�u�n� �l�o�c�a�l�l�y�
�
�
�
�#�#�#� �D�e�f�a�u�l�t� �(�S�T�D�I�O� �t�r�a�n�s�p�o�r�t�)�
�
����b�a�s�h� � �u�v� �r�u�n� �m�a�i�n�.�p�y� � ����
�
�
�
�#�#� �S�e�r�v�e�r� �E�n�v�i�r�o�n�m�e�n�t� �V�a�r�i�a�b�l�e�s�
�
�
�
�|� �V�a�r�i�a�b�l�e� �|� �P�u�r�p�o�s�e� �|� �D�e�f�a�u�l�t� �|�
�
�|�-�-�-�-�-�-�-�-�-�-�|�-�-�-�-�-�-�-�-�-�|�-�-�-�-�-�-�-�-�-�|�
�
�|� �A�P�P��T�R�A�N�S�P�O�R�T� �|� �T�r�a�n�s�p�o�r�t� �t�y�p�e� �(�S�T�D�I�O�,� �H�T�T�P�,� �S�S�E�)� �|� �S�T�D�I�O� �|�
�
�|� �A�P�P��H�O�S�T� �|� �S�e�r�v�e�r� �h�o�s�t� �|� �0�.�0�.�0�.�0� �|�
�
�|� �A�P�P�_�P�O�R�T� �|� �S�e�r�v�e�r� �p�o�r�t� �|� �8�0�0�0� �|�
�
�
�
�#�#� �D�o�c�k�e�r�
�
�
�
�B�u�i�l�d� �t�h�e� �i�m�a�g�e� �a�n�d� �r�u�n�:�
�
�
�
����b�a�s�h� � �d�o�c�k�e�r� �b�u�i�l�d� �-�t� �s�i�m�p�l�e�-�m�c�p� �.� � ����
�
�
�
�#�#�#� �D�o�c�k�e�r� �w�i�t�h� �d�i�f�f�e�r�e�n�t� �t�r�a�n�s�p�o�r�t�s�
�
�
�
����b�a�s�h� � �#� �H�T�T�P� �t�r�a�n�s�p�o�r�t� � �d�o�c�k�e�r� �r�u�n� �-�-�r�m� �-�p� �8�0�0�0�:�8�0�0�0� �-�e� �A�P�P�_�T�R�A�N�S�P�O�R�T�=�H�T�T�P� �s�i�m�p�l�e�-�m�c�p� � � � �#� �S�S�E� �t�r�a�n�s�p�o�r�t� � �d�o�c�k�e�r� �r�u�n� �-�-�r�m� �-�p� �8�0�0�0�:�8�0�0�0� �-�e� �A�P�P�_�T�R�A�N�S�P�O�R�T�=�S�S�E� �s�i�m�p�l�e�-�m�c�p� � � � �#� �C�u�s�t�o�m� �p�o�r�t� � �d�o�c�k�e�r� �r�u�n� �-�-�r�m� �-�p� �9�0�0�0�:�9�0�0�0� �-�e� �A�P�P�_�T�R�A�N�S�P�O�R�T�=�H�T�T�P� �-�e� �A�P�P�_�P�O�R�T�=�9�0�0�0� �s�i�m�p�l�e�-�m�c�p� � ����
�
�
�
�#�#� �T�e�s�t� �a�s� �a� �s�t�a�n�d�a�l�o�n�e� �a�p�p�
�
�#�#�#� �T�e�s�t� �u�s�i�n�g� �P�o�s�t�m�a�n�
�
���� � �u�v� �-�-�d�i�r�e�c�t�o�r�y� �<�p�a�t�h�_�t�o�_�p�r�o�j�e�c�t�_�d�i�r�e�c�t�o�r�y�>� �r�u�n� �m�a�i�n�.�p�y� � ����
�
�
�
�#�#�#� �T�e�s�t� �u�s�i�n�g� �C�l�a�u�d�e� �D�e�s�k�t�o�p�
�
����j�s�o�n� � �{� � � � �"�m�c�p�S�e�r�v�e�r�s�"�:� �{� � � � � � �"�s�i�m�p�l�e�_�m�c�p�"�:� �{� � � � � � � � �"�c�o�m�m�a�n�d�"�:� �"�u�v�"�,� � � � � � � � �"�a�r�g�s�"�:� �[� � � � � � � � � � �"�r�u�n�"�,� � � � � � � � � � �"�-�-�d�i�r�e�c�t�o�r�y�"�,� � � � � � � � � � �"�<�p�a�t�h�_�t�o�_�p�r�o�j�e�c�t�_�d�i�r�e�c�t�o�r�y�>�"�,� � � � � � � � � � �"�m�a�i�n�.�p�y�"� � � � � � � � �]� � � � � � �}� � � � �}� � �}� � ����
�
�
�
�#�#� �T�e�s�t� �a�s� �a� �d�o�c�k�e�r� �i�m�a�g�e�
�
�#�#�#� �T�e�s�t� �u�s�i�n�g� �P�o�s�t�m�a�n�
�
���� � �d�o�c�k�e�r� �r�u�n� �-�-�r�m� �-�i� �s�i�m�p�l�e�-�m�c�p� � ����
�
�
�
�#�#�#� �T�e�s�t� �u�s�i�n�g� �C�l�a�u�d�e� �D�e�s�k�t�o�p�
�
����j�s�o�n� � �{� � � � �"�m�c�p�S�e�r�v�e�r�s�"�:� �{� � � � � � �"�s�i�m�p�l�e�_�m�c�p�"�:� �{� � � � � � � � �"�c�o�m�m�a�n�d�"�:� �"�d�o�c�k�e�r�"�,� � � � � � � � �"�a�r�g�s�"�:� �[� � � � � � � � � � �"�r�u�n�"�,� � � � � � � � � � �"�-�-�r�m�"�,� � � � � � � � � � �"�-�i�"�,� � � � � � � � � � �"�s�i�m�p�l�e�-�m�c�p�"� � � � � � � � �]� � � � � � �}� � � � �}� � �}� � ����
APP_TRANSPORTdefault: STDIOTransport type
APP_HOSTdefault: 0.0.0.0Server host
APP_PORTdefault: 8000Server port