Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 162 additions & 0 deletions debian/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
#!groovy

// Current version of this Pipeline https://github.com/VitexSoftware/BuildImages/blob/main/Test/Jenkinsfile-parael

String[] distributions = [
//'debian:bookworm',
'debian:trixie',
//'debian:forky',
//'ubuntu:jammy',
//'ubuntu:noble'
]

String vendor = 'vitexsoftware'
//String distroFamily = ''

properties([
copyArtifactPermission('*')
])
node() {
ansiColor('xterm') {
stage('SCM Checkout') {
checkout scm
}
}
}

def branches = [:]
distributions.each { distro ->
branches[distro] = {
def distroName = distro
println "Dist:" + distroName

def dist = distroName.split(':')
def distroFamily = dist[0]
def distroCode = dist[1]
def buildImage = ''
def artifacts = []
def buildVer = ''

node {
ansiColor('xterm') {
stage('Checkout ' + distroName) {
checkout scm
def imageName = vendor + '/' + distro
buildImage = docker.image(imageName)
sh 'git checkout debian/changelog'
def version = sh (
script: 'dpkg-parsechangelog --show-field Version',
returnStdout: true
).trim()
buildVer = version + '.' + env.BUILD_NUMBER + '~' + distroCode
}
stage('Build ' + distroName) {
buildImage.inside {
// Set unique build directories for this parallel build to avoid conflicts
def uniqueBuildId = env.BUILD_NUMBER + '-' + distroCode + '-' + env.EXECUTOR_NUMBER
sh '''
export DH_INTERNAL_BUILDDIR="/tmp/debhelper-build-''' + uniqueBuildId + '''"
export TMPDIR="/tmp/build-''' + uniqueBuildId + '''"
mkdir -p "$DH_INTERNAL_BUILDDIR" "$TMPDIR"
'''
sh 'dch -b -v ' + buildVer + ' "' + env.BUILD_TAG + '"'
sh 'sudo apt-get update --allow-releaseinfo-change'
sh 'sudo chown jenkins:jenkins ..'
sh 'sudo rm -rf debian/$(dpkg-parsechangelog --show-field Source)/ debian/.debhelper/ debian/tmp/'
sh '''
export DH_INTERNAL_BUILDDIR="/tmp/debhelper-build-''' + uniqueBuildId + '''"
export TMPDIR="/tmp/build-''' + uniqueBuildId + '''"
debuild-pbuilder -r"sudo -E" -i -us -uc -b
'''
sh 'mkdir -p $WORKSPACE/dist/debian/ ; rm -rf $WORKSPACE/dist/debian/* ; for deb in $(cat debian/files | awk \'{print $1}\'); do mv "../$deb" $WORKSPACE/dist/debian/; done'
artifacts = sh (
script: "cat debian/files | awk '{print \$1}'",
returnStdout: true
).trim().split('\n')
}
}

stage('Test ' + distroName) {
buildImage.inside {
def debconf_debug = 0 //Set to "5" or "developer" to debug debconf
sh 'cd $WORKSPACE/dist/debian/ ; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz; cd $WORKSPACE'
sh 'echo "deb [trusted=yes] file://///$WORKSPACE/dist/debian/ ./" | sudo tee /etc/apt/sources.list.d/local.list'
sh 'sudo apt-get update --allow-releaseinfo-change'
sh 'echo "INSTALATION"'

def installOrder = [
// '',
]

def sorted_artifacts = artifacts.toList()

// If installOrder is empty, install all produced packages
if (installOrder.isEmpty()) {
sorted_artifacts.each { deb_file ->
if (deb_file.endsWith('.deb')) {
def pkgName = deb_file.tokenize('/')[-1].replaceFirst(/_.*/, '')
sh 'echo -e "${GREEN} installing ' + pkgName + ' on `lsb_release -sc` ${ENDCOLOR} "'
sh 'sudo DEBIAN_FRONTEND=noninteractive DEBCONF_DEBUG=' + debconf_debug + ' apt-get -y install ' + pkgName
}
}
} else {
// Install packages in specified order
installOrder.each { pkgPrefix ->
def debFile = null
for (item in sorted_artifacts) {
def itemStr = item.toString()
if (itemStr.startsWith(pkgPrefix) && itemStr.endsWith('.deb')) {
debFile = itemStr
break
}
}
if (debFile) {
def pkgName = debFile.tokenize('/')[-1].replaceFirst(/_.*/, '')
sh 'echo -e "${GREEN} installing ' + pkgName + ' on `lsb_release -sc` ${ENDCOLOR} "'
sh 'sudo DEBIAN_FRONTEND=noninteractive DEBCONF_DEBUG=' + debconf_debug + ' apt-get -y install ' + pkgName
}
}
}

}
stage('Archive artifacts ' + distroName ) {
// Only run if previous stages (Build and Test) succeeded
buildImage.inside {
// Archive all produced artifacts listed in debian/files
artifacts.each { deb_file ->
println "Archiving artifact: " + deb_file
archiveArtifacts artifacts: 'dist/debian/' + deb_file
}

// Cleanup: remove any produced files named in debian/files
// Try both the dist location and any potential original locations referenced by debian/files
def uniqueBuildId = env.BUILD_NUMBER + '-' + distroCode + '-' + env.EXECUTOR_NUMBER
sh '''
set -e
if [ -f debian/files ]; then
while read -r file _; do
[ -n "$file" ] || continue
rm -f "dist/debian/$file" || true
rm -f "../$file" || true
rm -f "$WORKSPACE/$file" || true
done < debian/files
fi
# Cleanup temporary build directories
rm -rf "/tmp/debhelper-build-''' + uniqueBuildId + '''" || true
rm -rf "/tmp/build-''' + uniqueBuildId + '''" || true
'''
}
}
}
}
}
}
}

parallel branches

node {
stage('Publish to Aptly') {
publishDebToAptly()
}
}
18 changes: 18 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
python-mcp (2.0.0~alpha1-1) unstable; urgency=medium

* Adopt upstream changes from main branch (v2.0.0-alpha)
* Update dependencies to match upstream requirements
* Update pydantic to >= 2.12.0
* Update jsonschema to >= 4.20.0
* Update sse-starlette to >= 3.0.0
* Update python3-jwt to >= 2.10.1
* Update typing-extensions to >= 4.13.0

-- Vítězslav Dvořák <info@vitexsoftware.cz> Sat, 22 Feb 2026 22:56:00 +0100

python-mcp (1.26.0-1) unstable; urgency=medium

* Initial Debian package release
* Model Context Protocol SDK v1.26.0

-- Vítězslav Dvořák <info@vitexsoftware.cz> Sat, 25 Jan 2026 23:34:00 +0100
58 changes: 58 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Source: python-mcp
Section: python
Priority: optional
Maintainer: Vítězslav Dvořák <info@vitexsoftware.cz>
Build-Depends:
debhelper-compat (= 13),
dh-python,
pybuild-plugin-pyproject,
python3-all,
python3-hatchling,
Standards-Version: 4.7.0
Homepage: https://modelcontextprotocol.io
Vcs-Git: https://github.com/modelcontextprotocol/python-sdk.git
Vcs-Browser: https://github.com/modelcontextprotocol/python-sdk
Rules-Requires-Root: no

Package: python3-mcp
Architecture: all
Depends:
${misc:Depends},
${python3:Depends},
python3-anyio (>= 4.5),
python3-httpx (>= 0.27.1),
python3-httpx-sse (>= 0.4),
python3-pydantic (>= 2.12.0),
python3-starlette (>= 0.27),
python3-multipart (>= 0.0.9),
python3-sse-starlette (>= 3.0.0),
python3-pydantic-settings (>= 2.5.2),
python3-uvicorn (>= 0.31.1),
python3-jsonschema (>= 4.20.0),
python3-jwt (>= 2.10.1),
python3-typing-extensions (>= 4.13.0),
python3-typing-inspection (>= 0.4.1),
Suggests:
python3-rich (>= 13.9.4),
python3-typer (>= 0.16.0),
python3-dotenv (>= 1.0.0),
python3-websockets (>= 15.0.1),
Description: Model Context Protocol SDK for Python
The Model Context Protocol (MCP) provides a standardized way to
connect AI agents to tools and data sources. This SDK implements the
MCP specification in Python.
.
MCP enables developers to build secure, bidirectional connections
between AI applications (clients) and external data sources or tools
(servers). The protocol is built on JSON-RPC 2.0 and supports multiple
transport mechanisms.
.
Features include:
* Server and client implementations
* Multiple transport protocols (stdio, SSE, WebSocket)
* Resource management
* Tool invocation
* Prompt templates
* Authentication support
.
This package provides the Python 3 library.
31 changes: 31 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: mcp
Upstream-Contact: David Soria Parra <davidsp@anthropic.com>
Source: https://github.com/modelcontextprotocol/python-sdk

Files: *
Copyright: 2024 Anthropic, PBC
License: MIT

Files: debian/*
Copyright: 2026 Vítězslav Dvořák <info@vitexsoftware.cz>
License: MIT

License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
20 changes: 20 additions & 0 deletions debian/io.modelcontextprotocol.python_sdk.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="addon">
<id>io.modelcontextprotocol.python_sdk</id>
<icon type="stock">python3-mcp</icon>
<metadata_license>MIT</metadata_license>
<project_license>MIT</project_license>
<name>Python MCP SDK</name>
<summary>Model Context Protocol SDK for Python</summary>
<description>
<p>
The Model Context Protocol (MCP) Python SDK enables building MCP servers and clients. MCP is an open protocol that standardizes how applications provide context to LLMs, enabling integration between AI models and external data sources or tools.
</p>
</description>
<url type="homepage">https://modelcontextprotocol.io</url>
<url type="bugtracker">https://github.com/modelcontextprotocol/python-sdk/issues</url>
<developer id="io.modelcontextprotocol">
<name>Anthropic</name>
</developer>
<content_rating type="oars-1.1"/>
</component>
2 changes: 2 additions & 0 deletions debian/python3-mcp.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
python3-mcp.svg usr/share/icons/hicolor/scalable/apps/
io.modelcontextprotocol.python_sdk.metainfo.xml usr/share/metainfo/
22 changes: 22 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/make -f

export PYBUILD_NAME=mcp
export PEP440_VERSION := $(shell dpkg-parsechangelog -S Version | cut -d- -f1 | sed 's/~alpha/a/;s/~beta/b/;s/~rc/rc/')
%:
dh $@ --with python3 --buildsystem=pybuild

override_dh_auto_configure:
# Patch to use static version from changelog (converted to PEP 440)
sed -i 's/dynamic = \["version"\]/version = "$(PEP440_VERSION)"/' pyproject.toml
sed -i 's/requires = \["hatchling", "uv-dynamic-versioning"\]/requires = ["hatchling"]/' pyproject.toml
sed -i '/\[tool.hatch.version\]/,/^$$/d' pyproject.toml
sed -i '/\[tool.uv-dynamic-versioning\]/,/^$$/d' pyproject.toml
dh_auto_configure

override_dh_auto_test:
# Skip tests

override_dh_auto_clean:
dh_auto_clean
# Restore if needed
git checkout pyproject.toml 2>/dev/null || true
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (native)
12 changes: 2 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mcp"
dynamic = ["version"]
version = "2.0.0a1"
description = "Model Context Protocol SDK"
readme = "README.md"
requires-python = ">=3.10"
Expand Down Expand Up @@ -84,17 +84,9 @@ docs = [
]

[build-system]
requires = ["hatchling", "uv-dynamic-versioning"]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.version]
source = "uv-dynamic-versioning"

[tool.uv-dynamic-versioning]
vcs = "git"
style = "pep440"
bump = true

[project.urls]
Homepage = "https://modelcontextprotocol.io"
Repository = "https://github.com/modelcontextprotocol/python-sdk"
Expand Down
5 changes: 5 additions & 0 deletions python3-mcp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading