ultratransfer-mcp 0.4.13__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ultratransfer_mcp-0.4.13/LICENSE +21 -0
- ultratransfer_mcp-0.4.13/PKG-INFO +21 -0
- ultratransfer_mcp-0.4.13/README.md +7 -0
- ultratransfer_mcp-0.4.13/pyproject.toml +33 -0
- ultratransfer_mcp-0.4.13/setup.cfg +4 -0
- ultratransfer_mcp-0.4.13/ultra_agent/__init__.py +2 -0
- ultratransfer_mcp-0.4.13/ultra_agent/a2a_context.py +62 -0
- ultratransfer_mcp-0.4.13/ultra_agent/access_policy.py +86 -0
- ultratransfer_mcp-0.4.13/ultra_agent/agent_donation.py +47 -0
- ultratransfer_mcp-0.4.13/ultra_agent/agent_exchange.py +484 -0
- ultratransfer_mcp-0.4.13/ultra_agent/agent_setup.py +147 -0
- ultratransfer_mcp-0.4.13/ultra_agent/agent_trial.py +125 -0
- ultratransfer_mcp-0.4.13/ultra_agent/artifacts.py +200 -0
- ultratransfer_mcp-0.4.13/ultra_agent/binary_delta.py +303 -0
- ultratransfer_mcp-0.4.13/ultra_agent/context_cache.py +261 -0
- ultratransfer_mcp-0.4.13/ultra_agent/context_handoff.py +93 -0
- ultratransfer_mcp-0.4.13/ultra_agent/context_sync.py +113 -0
- ultratransfer_mcp-0.4.13/ultra_agent/donations.py +61 -0
- ultratransfer_mcp-0.4.13/ultra_agent/engine.py +929 -0
- ultratransfer_mcp-0.4.13/ultra_agent/knowledge_search.py +357 -0
- ultratransfer_mcp-0.4.13/ultra_agent/large_context.py +283 -0
- ultratransfer_mcp-0.4.13/ultra_agent/large_context_cache.py +101 -0
- ultratransfer_mcp-0.4.13/ultra_agent/lightning_donation.py +57 -0
- ultratransfer_mcp-0.4.13/ultra_agent/mcp_server.py +316 -0
- ultratransfer_mcp-0.4.13/ultra_agent/multi_delta.py +143 -0
- ultratransfer_mcp-0.4.13/ultra_agent/native_stdio.py +188 -0
- ultratransfer_mcp-0.4.13/ultra_agent/pacing.py +25 -0
- ultratransfer_mcp-0.4.13/ultra_agent/peer_context.py +87 -0
- ultratransfer_mcp-0.4.13/ultra_agent/range_transport.py +1047 -0
- ultratransfer_mcp-0.4.13/ultra_agent/remote_mcp.py +419 -0
- ultratransfer_mcp-0.4.13/ultra_agent/remote_pool.py +84 -0
- ultratransfer_mcp-0.4.13/ultra_agent/text_delta.py +83 -0
- ultratransfer_mcp-0.4.13/ultra_agent/xrp_donation.py +56 -0
- ultratransfer_mcp-0.4.13/ultratransfer_mcp.egg-info/PKG-INFO +21 -0
- ultratransfer_mcp-0.4.13/ultratransfer_mcp.egg-info/SOURCES.txt +37 -0
- ultratransfer_mcp-0.4.13/ultratransfer_mcp.egg-info/dependency_links.txt +1 -0
- ultratransfer_mcp-0.4.13/ultratransfer_mcp.egg-info/entry_points.txt +9 -0
- ultratransfer_mcp-0.4.13/ultratransfer_mcp.egg-info/requires.txt +4 -0
- ultratransfer_mcp-0.4.13/ultratransfer_mcp.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Maher Daoud-Brikci
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ultratransfer-mcp
|
|
3
|
+
Version: 0.4.13
|
|
4
|
+
Summary: Verified local file and knowledge exchange for AI agents
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Repository, https://github.com/mmxb8/UltraTransfer
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: mcp<3,>=2
|
|
11
|
+
Provides-Extra: sharing
|
|
12
|
+
Requires-Dist: cryptography==50.0.2; extra == "sharing"
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# UltraTransfer MCP
|
|
16
|
+
|
|
17
|
+
Verified, permission-scoped artifact exchange and incremental context reuse for AI agents.
|
|
18
|
+
See https://github.com/mmxb8/UltraTransfer for documentation.
|
|
19
|
+
No default workspace, no mandatory payments, no automatically started remote service. Private-network HTTPS is opt-in.
|
|
20
|
+
|
|
21
|
+
<!-- mcp-name: io.github.mmxb8/ultratransfer -->
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# UltraTransfer MCP
|
|
2
|
+
|
|
3
|
+
Verified, permission-scoped artifact exchange and incremental context reuse for AI agents.
|
|
4
|
+
See https://github.com/mmxb8/UltraTransfer for documentation.
|
|
5
|
+
No default workspace, no mandatory payments, no automatically started remote service. Private-network HTTPS is opt-in.
|
|
6
|
+
|
|
7
|
+
<!-- mcp-name: io.github.mmxb8/ultratransfer -->
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ultratransfer-mcp"
|
|
7
|
+
version = "0.4.13"
|
|
8
|
+
description = "Verified local file and knowledge exchange for AI agents"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.11"
|
|
13
|
+
dependencies = ["mcp>=2,<3"]
|
|
14
|
+
|
|
15
|
+
[project.optional-dependencies]
|
|
16
|
+
sharing = ["cryptography==50.0.2"]
|
|
17
|
+
|
|
18
|
+
[project.urls]
|
|
19
|
+
Repository = "https://github.com/mmxb8/UltraTransfer"
|
|
20
|
+
|
|
21
|
+
[project.scripts]
|
|
22
|
+
ultratransfer-mcp = "ultra_agent.mcp_server:main"
|
|
23
|
+
ultratransfer-mcp-setup = "ultra_agent.agent_setup:main"
|
|
24
|
+
ultratransfer-mcp-donation = "ultra_agent.agent_donation:main"
|
|
25
|
+
ultratransfer-mcp-xrp-donation = "ultra_agent.xrp_donation:main"
|
|
26
|
+
|
|
27
|
+
ultratransfert-mcp = "ultra_agent.mcp_server:main"
|
|
28
|
+
ultratransfert-mcp-setup = "ultra_agent.agent_setup:main"
|
|
29
|
+
ultratransfert-mcp-donation = "ultra_agent.agent_donation:main"
|
|
30
|
+
ultratransfert-mcp-xrp-donation = "ultra_agent.xrp_donation:main"
|
|
31
|
+
|
|
32
|
+
[tool.setuptools]
|
|
33
|
+
packages = ["ultra_agent"]
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""Opt-in A2A 1.0 message adapter; not an A2A server or authentication layer."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import re
|
|
5
|
+
import uuid
|
|
6
|
+
|
|
7
|
+
from .context_handoff import make_handoff, verify_handoff
|
|
8
|
+
from .engine import TransferError
|
|
9
|
+
|
|
10
|
+
EXTENSION = 'https://github.com/mmxb8/UltraTransfert/blob/main/docs/AGENT_A2A_CONTEXT.md'
|
|
11
|
+
ROLES = ('ROLE_USER', 'ROLE_AGENT')
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def extension_declaration():
|
|
15
|
+
return {'uri':EXTENSION,'description':'Verified scoped context references',
|
|
16
|
+
'required':False}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def make_message(scope_id, artifact_ids, *, role='ROLE_USER', context_id=None):
|
|
20
|
+
if role not in ROLES:
|
|
21
|
+
raise TransferError('Invalid A2A sender role.')
|
|
22
|
+
if (context_id is not None and (type(context_id) is not str or not re.fullmatch(r'[A-Za-z0-9_-]{1,128}',context_id))) or (role=='ROLE_AGENT' and context_id is None):
|
|
23
|
+
raise TransferError('Invalid or missing A2A context ID.')
|
|
24
|
+
return {**({'contextId':context_id} if context_id is not None else {}),'messageId':str(uuid.uuid4()),'role':role,
|
|
25
|
+
'extensions':[EXTENSION],
|
|
26
|
+
'parts':[{'data':make_handoff(scope_id,artifact_ids),
|
|
27
|
+
'mediaType':'application/json'}]}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def accept_message(context, message, *, expected_handoff_id, expected_role,
|
|
31
|
+
fetch_snapshot, extension_negotiated=False,
|
|
32
|
+
max_response_bytes=8192, expected_context_id=None):
|
|
33
|
+
"""Accept only our narrow message profile after external authentication.
|
|
34
|
+
|
|
35
|
+
The expected role, handoff digest, and extension negotiation must come
|
|
36
|
+
from trusted host state, never solely from the received message.
|
|
37
|
+
"""
|
|
38
|
+
if extension_negotiated is not True or expected_role not in ROLES:
|
|
39
|
+
raise TransferError('A2A context extension not negotiated.')
|
|
40
|
+
if (expected_context_id is not None and (type(expected_context_id) is not str or not re.fullmatch(r'[A-Za-z0-9_-]{1,128}',expected_context_id))) or (expected_role=='ROLE_AGENT' and expected_context_id is None):
|
|
41
|
+
raise TransferError('Invalid or missing trusted A2A context ID.')
|
|
42
|
+
fields = {'messageId','role','extensions','parts'} | ({'contextId'} if expected_context_id is not None else set())
|
|
43
|
+
if (type(message) is not dict
|
|
44
|
+
or set(message) != fields
|
|
45
|
+
or message.get('contextId') != expected_context_id
|
|
46
|
+
or message['role'] != expected_role
|
|
47
|
+
or message['extensions'] != [EXTENSION]
|
|
48
|
+
or not isinstance(message['messageId'],str)
|
|
49
|
+
or not re.fullmatch(r'[A-Za-z0-9_-]{1,128}',message['messageId'])):
|
|
50
|
+
raise TransferError('Invalid A2A context message.')
|
|
51
|
+
parts = message['parts']
|
|
52
|
+
if type(parts) is not list or len(parts)!=1 or type(parts[0]) is not dict:
|
|
53
|
+
raise TransferError('Invalid A2A context parts.')
|
|
54
|
+
part = parts[0]
|
|
55
|
+
if set(part) != {'data','mediaType'} or part['mediaType']!='application/json':
|
|
56
|
+
raise TransferError('Invalid A2A context data part.')
|
|
57
|
+
descriptor = part['data']
|
|
58
|
+
verify_handoff(descriptor,expected_scope=context.scope_id,
|
|
59
|
+
expected_handoff_id=expected_handoff_id)
|
|
60
|
+
return context.accept(descriptor,expected_handoff_id=expected_handoff_id,
|
|
61
|
+
fetch_snapshot=fetch_snapshot,
|
|
62
|
+
max_response_bytes=max_response_bytes)
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"""Host-controlled, revocable read grants for a dedicated local MCP consumer."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import json
|
|
5
|
+
import os
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
import stat
|
|
8
|
+
import time
|
|
9
|
+
|
|
10
|
+
from .artifacts import parse_id
|
|
11
|
+
from .engine import TransferError, is_link
|
|
12
|
+
|
|
13
|
+
MAX_POLICY_BYTES = 262144
|
|
14
|
+
MAX_GRANTS = 2048
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _policy_signature(info):
|
|
18
|
+
return (info.st_dev, info.st_ino, info.st_mode, info.st_nlink,
|
|
19
|
+
info.st_size, info.st_mtime_ns, info.st_ctime_ns)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AccessPolicy:
|
|
23
|
+
def __init__(self, path, excluded_roots):
|
|
24
|
+
self.path = Path(path).absolute()
|
|
25
|
+
# The policy must be outside every directory accessible through tools.
|
|
26
|
+
resolved = self.path.resolve()
|
|
27
|
+
if any(resolved == root or root in resolved.parents for root in excluded_roots):
|
|
28
|
+
raise TransferError("Access policy must be outside exchange roots.")
|
|
29
|
+
self.excluded_roots = tuple(excluded_roots)
|
|
30
|
+
|
|
31
|
+
def require(self, identifiers):
|
|
32
|
+
"""Fail closed, re-read policy per call so deletion and expiry revoke access."""
|
|
33
|
+
try:
|
|
34
|
+
if not isinstance(identifiers, (list, tuple)) or not 1 <= len(identifiers) <= 32:
|
|
35
|
+
raise ValueError("Invalid request scope")
|
|
36
|
+
requested = {parse_id(value) for value in identifiers}
|
|
37
|
+
before = self.path.lstat()
|
|
38
|
+
if is_link(before) or not stat.S_ISREG(before.st_mode) or before.st_nlink != 1:
|
|
39
|
+
raise ValueError("Invalid policy file")
|
|
40
|
+
if before.st_size > MAX_POLICY_BYTES:
|
|
41
|
+
raise ValueError("Policy too large")
|
|
42
|
+
resolved = self.path.resolve(strict=True)
|
|
43
|
+
if any(resolved == root or root in resolved.parents for root in self.excluded_roots):
|
|
44
|
+
raise ValueError("Policy moved inside exchange roots")
|
|
45
|
+
with self.path.open("rb") as stream:
|
|
46
|
+
opened = os.fstat(stream.fileno())
|
|
47
|
+
if (not os.path.samestat(before, opened) or not stat.S_ISREG(opened.st_mode)
|
|
48
|
+
or opened.st_nlink != 1 or opened.st_size != before.st_size
|
|
49
|
+
or opened.st_mtime_ns != before.st_mtime_ns):
|
|
50
|
+
raise ValueError("Policy replaced")
|
|
51
|
+
raw = stream.read(MAX_POLICY_BYTES + 1)
|
|
52
|
+
after = os.fstat(stream.fileno())
|
|
53
|
+
final = self.path.lstat()
|
|
54
|
+
# Compare full metadata within each API; Windows path and handle
|
|
55
|
+
# creation times or permission bits may differ legitimately.
|
|
56
|
+
if (len(raw) > MAX_POLICY_BYTES or len(raw) != before.st_size or
|
|
57
|
+
_policy_signature(opened) != _policy_signature(after) or
|
|
58
|
+
_policy_signature(before) != _policy_signature(final) or
|
|
59
|
+
not os.path.samestat(after, final) or
|
|
60
|
+
self.path.resolve(strict=True) != resolved):
|
|
61
|
+
raise ValueError("Policy changed")
|
|
62
|
+
def unique_pairs(pairs):
|
|
63
|
+
result = {}
|
|
64
|
+
for key, value in pairs:
|
|
65
|
+
if key in result:
|
|
66
|
+
raise ValueError("Duplicate policy key")
|
|
67
|
+
result[key] = value
|
|
68
|
+
return result
|
|
69
|
+
data = json.loads(raw, object_pairs_hook=unique_pairs)
|
|
70
|
+
if not isinstance(data, dict) or set(data) != {"schema", "grants"} or data["schema"] != "ultratransfert.grants.v1":
|
|
71
|
+
raise ValueError("Invalid schema")
|
|
72
|
+
grants = data["grants"]
|
|
73
|
+
if not isinstance(grants, dict) or len(grants) > MAX_GRANTS:
|
|
74
|
+
raise ValueError("Invalid grants")
|
|
75
|
+
now = time.time()
|
|
76
|
+
valid = set()
|
|
77
|
+
for identifier, expiry in grants.items():
|
|
78
|
+
sha = parse_id(identifier)
|
|
79
|
+
if type(expiry) is not int or not 0 < expiry <= 253402300799:
|
|
80
|
+
raise ValueError("Invalid expiration")
|
|
81
|
+
if expiry > now:
|
|
82
|
+
valid.add(sha)
|
|
83
|
+
if not requested <= valid:
|
|
84
|
+
raise ValueError("Not granted")
|
|
85
|
+
except (OSError, ValueError, TypeError, RecursionError, TransferError) as exc:
|
|
86
|
+
raise TransferError("Artifact access denied by host policy.") from None
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Offline voluntary Bitcoin payment instructions; never signs or sends funds."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import argparse
|
|
5
|
+
import json
|
|
6
|
+
from urllib.parse import urlencode, quote
|
|
7
|
+
|
|
8
|
+
from .donations import BITCOIN_ADDRESS, valid_bitcoin_address
|
|
9
|
+
|
|
10
|
+
SCHEMA = 'ultratransfert.donation.v1'
|
|
11
|
+
MAX_SATS = 21_000_000 * 100_000_000
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def donation_info(amount_sats: int | None = None) -> dict:
|
|
15
|
+
"""Describe an optional donation with an exact, caller-selected amount."""
|
|
16
|
+
if not valid_bitcoin_address(BITCOIN_ADDRESS):
|
|
17
|
+
raise ValueError('Invalid configured Bitcoin address.')
|
|
18
|
+
if amount_sats is not None and (type(amount_sats) is not int or not 1 <= amount_sats <= MAX_SATS):
|
|
19
|
+
raise ValueError('Amount must be a positive integer number of satoshis.')
|
|
20
|
+
params = {'label': 'UltraTransfert'}
|
|
21
|
+
amount_btc = None
|
|
22
|
+
if amount_sats is not None:
|
|
23
|
+
whole, fraction = divmod(amount_sats, 100_000_000)
|
|
24
|
+
amount_btc = f'{whole}.{fraction:08d}'
|
|
25
|
+
params['amount'] = amount_btc
|
|
26
|
+
uri = 'bitcoin:' + BITCOIN_ADDRESS + '?' + urlencode(params, quote_via=quote)
|
|
27
|
+
return {'schema': SCHEMA, 'asset': 'BTC', 'network': 'bitcoin-mainnet',
|
|
28
|
+
'address': BITCOIN_ADDRESS, 'amount_sats': amount_sats,
|
|
29
|
+
'amount_btc': amount_btc, 'payment_uri': uri, 'voluntary': True,
|
|
30
|
+
'features_require_payment': False, 'status': 'instructions_only',
|
|
31
|
+
'transaction_created': False,
|
|
32
|
+
'repository': 'https://github.com/mmxb8/UltraTransfert'}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def main(argv=None):
|
|
36
|
+
parser = argparse.ArgumentParser(description=__doc__)
|
|
37
|
+
parser.add_argument('--sats', type=int, help='Optional explicitly chosen amount in satoshis')
|
|
38
|
+
args = parser.parse_args(argv)
|
|
39
|
+
try:
|
|
40
|
+
print(json.dumps(donation_info(args.sats), indent=2))
|
|
41
|
+
except ValueError as exc:
|
|
42
|
+
parser.error(str(exc))
|
|
43
|
+
return 0
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
if __name__ == '__main__':
|
|
47
|
+
raise SystemExit(main())
|