taskadence-mcp 0.1.0__py3-none-any.whl
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.
- taskadence_mcp/__init__.py +14 -0
- taskadence_mcp/__main__.py +3 -0
- taskadence_mcp/_version.py +3 -0
- taskadence_mcp/cli.py +57 -0
- taskadence_mcp/config.py +131 -0
- taskadence_mcp/proxy.py +182 -0
- taskadence_mcp/py.typed +0 -0
- taskadence_mcp-0.1.0.dist-info/METADATA +222 -0
- taskadence_mcp-0.1.0.dist-info/RECORD +13 -0
- taskadence_mcp-0.1.0.dist-info/WHEEL +4 -0
- taskadence_mcp-0.1.0.dist-info/entry_points.txt +2 -0
- taskadence_mcp-0.1.0.dist-info/licenses/LICENSE +202 -0
- taskadence_mcp-0.1.0.dist-info/licenses/NOTICE +2 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""taskadence-mcp — TasKadence's MCP server for clients that start a local process.
|
|
2
|
+
|
|
3
|
+
A PROXY, not a second server: it speaks MCP over stdio to the client and forwards every JSON-RPC message to the
|
|
4
|
+
remote TasKadence MCP server (`<TASKADENCE_API_URL>/mcp`, Streamable HTTP) with
|
|
5
|
+
`Authorization: Bearer $TASKADENCE_TOKEN`.
|
|
6
|
+
The tools, the read-only / tool-group enforcement and the audit trail are the remote server's; this package has no
|
|
7
|
+
tool of its own (a test fails if it grows one).
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from ._version import __version__
|
|
11
|
+
from .config import Config, ConfigError, load_config
|
|
12
|
+
from .proxy import run_proxy
|
|
13
|
+
|
|
14
|
+
__all__ = ["Config", "ConfigError", "__version__", "load_config", "run_proxy"]
|
taskadence_mcp/cli.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""`taskadence-mcp` — the console script (`uvx taskadence-mcp`). Diagnostics go to stderr; stdout is JSON-RPC only."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import sys
|
|
7
|
+
import warnings
|
|
8
|
+
|
|
9
|
+
import anyio
|
|
10
|
+
|
|
11
|
+
from ._version import __version__
|
|
12
|
+
from .config import BRAND_NAME, GROUPS_ENV, READONLY_ENV, SLUG, TOKEN_ENV, URL_ENV, ConfigError, load_config, redact
|
|
13
|
+
from .proxy import run_proxy, stderr_log
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def parser() -> argparse.ArgumentParser:
|
|
17
|
+
p = argparse.ArgumentParser(
|
|
18
|
+
prog=f"{SLUG}-mcp",
|
|
19
|
+
description=f"{BRAND_NAME}'s MCP server over stdio: a proxy to the remote server (<api>/mcp). "
|
|
20
|
+
f"The token is read from {TOKEN_ENV}, never from a flag.",
|
|
21
|
+
epilog=f"Environment: {TOKEN_ENV} (required), {URL_ENV}, {READONLY_ENV}, {GROUPS_ENV}. Flags win.",
|
|
22
|
+
)
|
|
23
|
+
p.add_argument("--api-url", help=f"the API's origin (else {URL_ENV}, else production)")
|
|
24
|
+
p.add_argument(
|
|
25
|
+
"--readonly",
|
|
26
|
+
action=argparse.BooleanOptionalAction,
|
|
27
|
+
default=None,
|
|
28
|
+
help=f"only read tools, enforced by the server (else {READONLY_ENV})",
|
|
29
|
+
)
|
|
30
|
+
p.add_argument(
|
|
31
|
+
"--groups", help=f"comma-separated tool groups, e.g. tasks,projects (else {GROUPS_ENV}; default: all but admin)"
|
|
32
|
+
)
|
|
33
|
+
p.add_argument("--version", action="version", version=f"{BRAND_NAME} MCP ({SLUG}-mcp) {__version__}")
|
|
34
|
+
return p
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def main(argv: list[str] | None = None) -> int:
|
|
38
|
+
ns = parser().parse_args(argv)
|
|
39
|
+
try:
|
|
40
|
+
with warnings.catch_warnings(record=True) as caught: # a pre-rename variable: one stderr line
|
|
41
|
+
warnings.simplefilter("always", DeprecationWarning)
|
|
42
|
+
config = load_config(api_url=ns.api_url, readonly=ns.readonly, groups=ns.groups)
|
|
43
|
+
except ConfigError as exc:
|
|
44
|
+
stderr_log(str(exc))
|
|
45
|
+
return 2
|
|
46
|
+
for warning in caught:
|
|
47
|
+
stderr_log(f"warning: {warning.message}")
|
|
48
|
+
stderr_log(f"proxying stdio to {redact(config.mcp_url)}")
|
|
49
|
+
try:
|
|
50
|
+
anyio.run(run_proxy, config)
|
|
51
|
+
except KeyboardInterrupt:
|
|
52
|
+
return 130
|
|
53
|
+
return 0
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
if __name__ == "__main__":
|
|
57
|
+
sys.exit(main())
|
taskadence_mcp/config.py
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"""Where the proxy connects, as whom, and with which options — flags first, then the environment.
|
|
2
|
+
|
|
3
|
+
The names are `TASKADENCE_*` on purpose — the environment of the *packages* (and of the `tm` CLI, which reads
|
|
4
|
+
the same `TASKADENCE_TOKEN` / `TASKADENCE_API_URL`). The pre-rename `TASKSMATE_*` names are still read when the new one
|
|
5
|
+
is unset, with a `DeprecationWarning` (printed on stderr by the console script). `…_TM` suffixes are the API's own
|
|
6
|
+
server-side convention; do not "fix" these to match it.
|
|
7
|
+
|
|
8
|
+
TASKADENCE_TOKEN required — a `tkd_live_…` / `tkd_test_…` access token (Developers → Tokens; a pre-rename
|
|
9
|
+
`tm_live_…` / `tm_test_…` token works too)
|
|
10
|
+
TASKADENCE_API_URL the API's origin (default: production); `/mcp` is added here
|
|
11
|
+
TASKADENCE_MCP_READONLY `1` / `true` → `?readonly=1`: the SERVER lists and allows only read tools
|
|
12
|
+
TASKADENCE_MCP_GROUPS `tasks,projects` → `?groups=…`: the SERVER enables only those groups (`me` is always on)
|
|
13
|
+
|
|
14
|
+
Flags `--api-url`, `--readonly` / `--no-readonly`, `--groups` win over the environment. There is no `--token` flag:
|
|
15
|
+
a command line is visible to every process on the machine.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
from __future__ import annotations
|
|
19
|
+
|
|
20
|
+
import os
|
|
21
|
+
import re
|
|
22
|
+
import warnings
|
|
23
|
+
from collections.abc import Mapping
|
|
24
|
+
from dataclasses import dataclass, field
|
|
25
|
+
from urllib.parse import quote
|
|
26
|
+
|
|
27
|
+
BRAND_NAME = "TasKadence" # the wordmark (5.8c), prose only; `_brand.py` in the SDK is the source
|
|
28
|
+
SLUG = "taskadence"
|
|
29
|
+
ENV_PREFIX = "TASKADENCE_"
|
|
30
|
+
LEGACY_ENV_PREFIX = "TASKSMATE_" # pre-rename; read with a DeprecationWarning when the new name is unset
|
|
31
|
+
|
|
32
|
+
TOKEN_ENV = ENV_PREFIX + "TOKEN" # the variable NAME
|
|
33
|
+
URL_ENV = ENV_PREFIX + "API_URL"
|
|
34
|
+
READONLY_ENV = ENV_PREFIX + "MCP_READONLY"
|
|
35
|
+
GROUPS_ENV = ENV_PREFIX + "MCP_GROUPS"
|
|
36
|
+
|
|
37
|
+
# The production API — the Python SDK's DEFAULT_BASE_URL (the backend's clients table names the same one).
|
|
38
|
+
DEFAULT_API_URL = "https://api.taskadence.com"
|
|
39
|
+
MCP_PATH = "/mcp"
|
|
40
|
+
|
|
41
|
+
_TRUE, _FALSE = frozenset({"1", "true", "yes", "on"}), frozenset({"0", "false", "no", "off", ""})
|
|
42
|
+
# `tkd_live_` / `tkd_test_`, and the pre-rename `tm_live_` / `tm_test_` (those tokens keep working).
|
|
43
|
+
_TOKEN_SHAPED = re.compile(r"(?:tkd|tm)_(?:live|test)_[A-Za-z0-9_-]*")
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class ConfigError(ValueError):
|
|
47
|
+
"""A configuration the proxy cannot start with. The message never contains the token."""
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@dataclass(frozen=True)
|
|
51
|
+
class Config:
|
|
52
|
+
token: str = field(repr=False)
|
|
53
|
+
api_url: str
|
|
54
|
+
readonly: bool = False
|
|
55
|
+
groups: tuple[str, ...] | None = None
|
|
56
|
+
|
|
57
|
+
@property
|
|
58
|
+
def mcp_url(self) -> str:
|
|
59
|
+
"""`<api>/mcp[?readonly=1][&groups=a,b]` — the remote server's own URL contract (5.1)."""
|
|
60
|
+
query = []
|
|
61
|
+
if self.readonly:
|
|
62
|
+
query.append("readonly=1")
|
|
63
|
+
if self.groups is not None:
|
|
64
|
+
query.append("groups=" + quote(",".join(self.groups), safe=","))
|
|
65
|
+
return f"{self.api_url}{MCP_PATH}" + ("?" + "&".join(query) if query else "")
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def redact(text: str) -> str:
|
|
69
|
+
"""Anything token-shaped becomes `tkd_…` — a belt for every line this package writes."""
|
|
70
|
+
return _TOKEN_SHAPED.sub("tkd_…", text)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def _env(env: Mapping[str, str], name: str) -> str | None:
|
|
74
|
+
"""`name` (a `TASKADENCE_*` variable), else its deprecated `TASKSMATE_*` twin with a `DeprecationWarning`."""
|
|
75
|
+
if name in env:
|
|
76
|
+
return env[name]
|
|
77
|
+
legacy = LEGACY_ENV_PREFIX + name.removeprefix(ENV_PREFIX)
|
|
78
|
+
if legacy in env:
|
|
79
|
+
warnings.warn(
|
|
80
|
+
f"{legacy} is deprecated: {SLUG}-mcp reads {name}. Rename it in the client's MCP config.",
|
|
81
|
+
DeprecationWarning,
|
|
82
|
+
stacklevel=3,
|
|
83
|
+
)
|
|
84
|
+
return env[legacy]
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def _bool(name: str, value: str) -> bool:
|
|
89
|
+
v = value.strip().lower()
|
|
90
|
+
if v in _TRUE:
|
|
91
|
+
return True
|
|
92
|
+
if v in _FALSE:
|
|
93
|
+
return False
|
|
94
|
+
raise ConfigError(f"{name} must be 1 or 0 (got {value!r})")
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def _groups(value: str) -> tuple[str, ...]:
|
|
98
|
+
groups = tuple(dict.fromkeys(g.strip().lower() for g in value.split(",") if g.strip()))
|
|
99
|
+
if not groups:
|
|
100
|
+
raise ConfigError(
|
|
101
|
+
"groups is empty: name at least one group (e.g. tasks,projects), or leave it unset for the default"
|
|
102
|
+
)
|
|
103
|
+
return groups
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def _api_url(value: str) -> str:
|
|
107
|
+
url = value.strip().rstrip("/").removesuffix(MCP_PATH).removesuffix("/v1").rstrip("/")
|
|
108
|
+
if not url.startswith(("http://", "https://")):
|
|
109
|
+
raise ConfigError(f"{URL_ENV} / --api-url must start with http:// or https:// (got {redact(value)!r})")
|
|
110
|
+
return url
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def load_config(
|
|
114
|
+
*,
|
|
115
|
+
api_url: str | None = None,
|
|
116
|
+
readonly: bool | None = None,
|
|
117
|
+
groups: str | None = None,
|
|
118
|
+
environ: Mapping[str, str] | None = None,
|
|
119
|
+
) -> Config:
|
|
120
|
+
"""The flags (None = not given) over the environment."""
|
|
121
|
+
env = os.environ if environ is None else environ
|
|
122
|
+
token = (_env(env, TOKEN_ENV) or "").strip()
|
|
123
|
+
if not token:
|
|
124
|
+
raise ConfigError(
|
|
125
|
+
f"{TOKEN_ENV} is not set: create an access token in {BRAND_NAME} (Developers → Tokens) and put it in the "
|
|
126
|
+
f"client's MCP config as {TOKEN_ENV}"
|
|
127
|
+
)
|
|
128
|
+
url = _api_url(api_url if api_url is not None else (_env(env, URL_ENV) or DEFAULT_API_URL))
|
|
129
|
+
ro = readonly if readonly is not None else _bool(READONLY_ENV, _env(env, READONLY_ENV) or "")
|
|
130
|
+
raw_groups = groups if groups is not None else (_env(env, GROUPS_ENV) or None) # an empty variable = unset
|
|
131
|
+
return Config(token=token, api_url=url, readonly=ro, groups=_groups(raw_groups) if raw_groups is not None else None)
|
taskadence_mcp/proxy.py
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"""The bridge: MCP over stdio on one side, the remote server over Streamable HTTP on the other.
|
|
2
|
+
|
|
3
|
+
Every JSON-RPC message the client writes goes to the server unchanged (`initialize` included — the server is
|
|
4
|
+
stateless), and every message the server answers goes back unchanged; `tools/list` is the server's list. The SDK's
|
|
5
|
+
own transports do the protocol work (`mcp.server.stdio.stdio_server`, `mcp.client.streamable_http`).
|
|
6
|
+
|
|
7
|
+
One thing is added: an HTTP refusal becomes a JSON-RPC error. The SDK's HTTP client turns a non-2xx answer into an
|
|
8
|
+
exception that no request is waiting for — the client would hang. `ProblemTransport` (an httpx transport wrapper)
|
|
9
|
+
answers such a POST itself with a JSON-RPC error for THAT request id: a 401 names `TASKADENCE_TOKEN` (never its value),
|
|
10
|
+
a 400 carries the server's problem detail (an unknown group), anything else the status and detail; an unreachable
|
|
11
|
+
server says so. Each also writes one line to stderr. stdout carries JSON-RPC only.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import sys
|
|
18
|
+
from collections.abc import Callable
|
|
19
|
+
from typing import Any, TextIO
|
|
20
|
+
|
|
21
|
+
import anyio
|
|
22
|
+
import httpx
|
|
23
|
+
from anyio.abc import ObjectReceiveStream, ObjectSendStream
|
|
24
|
+
from mcp.client.streamable_http import streamable_http_client
|
|
25
|
+
from mcp.shared.message import SessionMessage
|
|
26
|
+
from mcp.types import JSONRPCError, JSONRPCRequest, JSONRPCResponse
|
|
27
|
+
|
|
28
|
+
from ._version import __version__
|
|
29
|
+
from .config import BRAND_NAME, SLUG, TOKEN_ENV, Config, redact
|
|
30
|
+
|
|
31
|
+
UNAUTHORIZED = -32001 # JSON-RPC implementation-defined server errors: -32000 … -32099
|
|
32
|
+
HTTP_ERROR = -32002
|
|
33
|
+
UNREACHABLE = -32003
|
|
34
|
+
DRAIN_SECONDS = 30.0 # after stdin closes: how long answers still in flight are waited for
|
|
35
|
+
|
|
36
|
+
Log = Callable[[str], None]
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def stderr_log(line: str) -> None:
|
|
40
|
+
print(f"{SLUG}-mcp: {redact(line)}", file=sys.stderr, flush=True)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _problem(response_body: bytes) -> dict[str, Any]:
|
|
44
|
+
try:
|
|
45
|
+
body = json.loads(response_body or b"{}")
|
|
46
|
+
except ValueError:
|
|
47
|
+
return {}
|
|
48
|
+
return body if isinstance(body, dict) else {}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _jsonrpc_error(request_id: Any, code: int, message: str, data: dict[str, Any]) -> httpx.Response:
|
|
52
|
+
payload = {"jsonrpc": "2.0", "id": request_id, "error": {"code": code, "message": redact(message), "data": data}}
|
|
53
|
+
return httpx.Response(200, headers={"content-type": "application/json"}, content=json.dumps(payload).encode())
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class ProblemTransport(httpx.AsyncBaseTransport):
|
|
57
|
+
"""Wraps the real transport: a refused or failed POST of a request is answered with a JSON-RPC error."""
|
|
58
|
+
|
|
59
|
+
def __init__(self, inner: httpx.AsyncBaseTransport, log: Log = stderr_log) -> None:
|
|
60
|
+
self._inner = inner
|
|
61
|
+
self._log = log
|
|
62
|
+
|
|
63
|
+
async def handle_async_request(self, request: httpx.Request) -> httpx.Response:
|
|
64
|
+
rpc = self._rpc(request)
|
|
65
|
+
try:
|
|
66
|
+
response = await self._inner.handle_async_request(request)
|
|
67
|
+
except httpx.TransportError as exc:
|
|
68
|
+
if rpc is None:
|
|
69
|
+
raise
|
|
70
|
+
where = f"{request.url.scheme}://{request.url.host}" + (f":{request.url.port}" if request.url.port else "")
|
|
71
|
+
self._log(f"cannot reach {where} ({type(exc).__name__}) — check TASKADENCE_API_URL and the network")
|
|
72
|
+
return self._answer(rpc, UNREACHABLE, f"{BRAND_NAME} MCP server unreachable at {where}", {"url": where})
|
|
73
|
+
if rpc is None or response.status_code < 400:
|
|
74
|
+
return response
|
|
75
|
+
body = await response.aread()
|
|
76
|
+
await response.aclose()
|
|
77
|
+
problem = _problem(body)
|
|
78
|
+
detail = str(problem.get("detail") or problem.get("title") or response.reason_phrase)
|
|
79
|
+
data: dict[str, Any] = {
|
|
80
|
+
"status": response.status_code,
|
|
81
|
+
**{k: problem[k] for k in ("type", "title", "detail", "errors", "request_id") if k in problem},
|
|
82
|
+
}
|
|
83
|
+
if response.status_code == 401:
|
|
84
|
+
self._log(f"the server refused {TOKEN_ENV} (401): {detail}")
|
|
85
|
+
message = (
|
|
86
|
+
f"{BRAND_NAME} refused the access token in {TOKEN_ENV} (401): {detail}. "
|
|
87
|
+
"Create one in Developers → Tokens."
|
|
88
|
+
)
|
|
89
|
+
return self._answer(rpc, UNAUTHORIZED, message, data)
|
|
90
|
+
self._log(f"the server answered {response.status_code}: {detail}")
|
|
91
|
+
return self._answer(rpc, HTTP_ERROR, f"{BRAND_NAME} MCP server: {response.status_code} {detail}", data)
|
|
92
|
+
|
|
93
|
+
@staticmethod
|
|
94
|
+
def _rpc(request: httpx.Request) -> dict[str, Any] | None:
|
|
95
|
+
"""The JSON-RPC message a POST carries, or None (a GET / DELETE, or a body that is not JSON)."""
|
|
96
|
+
if request.method != "POST":
|
|
97
|
+
return None
|
|
98
|
+
try:
|
|
99
|
+
body = json.loads(request.content or b"null")
|
|
100
|
+
except ValueError:
|
|
101
|
+
return None
|
|
102
|
+
return body if isinstance(body, dict) else None
|
|
103
|
+
|
|
104
|
+
@staticmethod
|
|
105
|
+
def _answer(rpc: dict[str, Any], code: int, message: str, data: dict[str, Any]) -> httpx.Response:
|
|
106
|
+
if "id" not in rpc or "method" not in rpc: # a notification (or a response): nothing waits for an answer
|
|
107
|
+
return httpx.Response(202)
|
|
108
|
+
return _jsonrpc_error(rpc["id"], code, message, data)
|
|
109
|
+
|
|
110
|
+
async def aclose(self) -> None:
|
|
111
|
+
await self._inner.aclose()
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def http_client(
|
|
115
|
+
config: Config, *, transport: httpx.AsyncBaseTransport | None = None, log: Log = stderr_log
|
|
116
|
+
) -> httpx.AsyncClient:
|
|
117
|
+
"""The client the SDK's Streamable HTTP transport uses: the bearer, our User-Agent, MCP's timeouts."""
|
|
118
|
+
inner = transport or httpx.AsyncHTTPTransport()
|
|
119
|
+
return httpx.AsyncClient(
|
|
120
|
+
transport=ProblemTransport(inner, log),
|
|
121
|
+
headers={"Authorization": f"Bearer {config.token}", "User-Agent": f"{SLUG}-mcp/{__version__} (python)"},
|
|
122
|
+
timeout=httpx.Timeout(30.0, read=300.0),
|
|
123
|
+
follow_redirects=False,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
async def bridge(
|
|
128
|
+
client_read: ObjectReceiveStream[SessionMessage | Exception],
|
|
129
|
+
client_write: ObjectSendStream[SessionMessage],
|
|
130
|
+
config: Config,
|
|
131
|
+
*,
|
|
132
|
+
transport: httpx.AsyncBaseTransport | None = None,
|
|
133
|
+
log: Log = stderr_log,
|
|
134
|
+
) -> None:
|
|
135
|
+
"""Forward messages both ways until the client closes its side (stdin EOF); then answer what is still in flight
|
|
136
|
+
(at most `DRAIN_SECONDS`) and close the client's side, so the process ends."""
|
|
137
|
+
pending: set[Any] = set() # ids of requests sent upstream and not answered yet
|
|
138
|
+
async with (
|
|
139
|
+
client_write,
|
|
140
|
+
http_client(config, transport=transport, log=log) as http,
|
|
141
|
+
streamable_http_client(config.mcp_url, http_client=http, terminate_on_close=False) as (
|
|
142
|
+
server_read,
|
|
143
|
+
server_write,
|
|
144
|
+
_,
|
|
145
|
+
),
|
|
146
|
+
anyio.create_task_group() as tg,
|
|
147
|
+
):
|
|
148
|
+
|
|
149
|
+
async def upstream() -> None:
|
|
150
|
+
async for message in client_read:
|
|
151
|
+
if isinstance(message, Exception):
|
|
152
|
+
log(f"ignored a message that is not JSON-RPC: {type(message).__name__}")
|
|
153
|
+
continue
|
|
154
|
+
if isinstance(message.message.root, JSONRPCRequest):
|
|
155
|
+
pending.add(message.message.root.id)
|
|
156
|
+
await server_write.send(message)
|
|
157
|
+
with anyio.move_on_after(DRAIN_SECONDS):
|
|
158
|
+
while pending:
|
|
159
|
+
await anyio.sleep(0.02)
|
|
160
|
+
tg.cancel_scope.cancel()
|
|
161
|
+
|
|
162
|
+
async def downstream() -> None:
|
|
163
|
+
async for message in server_read:
|
|
164
|
+
if isinstance(message, Exception):
|
|
165
|
+
log(f"transport error: {type(message).__name__}: {message}")
|
|
166
|
+
continue
|
|
167
|
+
if isinstance(message.message.root, JSONRPCResponse | JSONRPCError):
|
|
168
|
+
pending.discard(message.message.root.id)
|
|
169
|
+
await client_write.send(message)
|
|
170
|
+
|
|
171
|
+
tg.start_soon(upstream)
|
|
172
|
+
tg.start_soon(downstream)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
async def run_proxy(config: Config, *, stdin: TextIO | None = None, stdout: TextIO | None = None) -> None:
|
|
176
|
+
"""stdio ↔ the remote server, for the life of the process."""
|
|
177
|
+
from mcp.server.stdio import stdio_server
|
|
178
|
+
|
|
179
|
+
stdin_stream = anyio.wrap_file(stdin) if stdin is not None else None
|
|
180
|
+
stdout_stream = anyio.wrap_file(stdout) if stdout is not None else None
|
|
181
|
+
async with stdio_server(stdin_stream, stdout_stream) as (read, write):
|
|
182
|
+
await bridge(read, write, config)
|
taskadence_mcp/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: taskadence-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: The TasKadence MCP server for clients that start a local process: a stdio proxy to the remote server (uvx taskadence-mcp).
|
|
5
|
+
Project-URL: Homepage, https://taskadence.com
|
|
6
|
+
Project-URL: Documentation, https://docs.taskadence.com/mcp/connect/
|
|
7
|
+
Project-URL: Source, https://github.com/indrasol/taskadence-python/tree/main/packages/taskadence-mcp
|
|
8
|
+
Project-URL: Issues, https://github.com/indrasol/taskadence-python/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/indrasol/taskadence-python/blob/main/CHANGELOG.md
|
|
10
|
+
Author: Indrasol
|
|
11
|
+
License-Expression: Apache-2.0
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
License-File: NOTICE
|
|
14
|
+
Keywords: agents,ai,claude,mcp,model context protocol,stdio,taskadence
|
|
15
|
+
Classifier: Development Status :: 3 - Alpha
|
|
16
|
+
Classifier: Environment :: Console
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Topic :: Office/Business :: Scheduling
|
|
26
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
27
|
+
Classifier: Typing :: Typed
|
|
28
|
+
Requires-Python: >=3.10
|
|
29
|
+
Requires-Dist: httpx<1,>=0.27
|
|
30
|
+
Requires-Dist: mcp<2,>=1.30
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: anyio>=4; extra == 'dev'
|
|
33
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
34
|
+
Requires-Dist: mypy<2.4,>=1.11; extra == 'dev'
|
|
35
|
+
Requires-Dist: pip-audit>=2.7; extra == 'dev'
|
|
36
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
37
|
+
Requires-Dist: ruff==0.16.9; extra == 'dev'
|
|
38
|
+
Requires-Dist: starlette>=0.40; extra == 'dev'
|
|
39
|
+
Requires-Dist: twine>=5; extra == 'dev'
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
|
|
42
|
+
# taskadence-mcp: TasKadence for AI assistants that start a local program
|
|
43
|
+
|
|
44
|
+
[](https://pypi.org/project/taskadence-mcp/)
|
|
45
|
+
[](https://pypi.org/project/taskadence-mcp/)
|
|
46
|
+
[](https://github.com/indrasol/taskadence-python/blob/main/LICENSE)
|
|
47
|
+
|
|
48
|
+
[TasKadence](https://taskadence.com) is task and project management for teams. `taskadence-mcp` lets an AI assistant
|
|
49
|
+
(Claude Desktop, Claude Code, Cursor, VS Code and others) read and update your TasKadence tasks, projects and teams,
|
|
50
|
+
through the Model Context Protocol (MCP).
|
|
51
|
+
|
|
52
|
+
**Do I need this, or the URL?** If your assistant can add an MCP server by URL (often called a remote server or a
|
|
53
|
+
custom connector), use the URL `https://api.taskadence.com/mcp` instead: you sign in with OAuth and there is no token
|
|
54
|
+
to manage. See [Connect](https://docs.taskadence.com/mcp/connect/). Use this package when your assistant can only start
|
|
55
|
+
a local program (a "stdio" server), or when you want it to use a token you created yourself.
|
|
56
|
+
|
|
57
|
+
Its twin on npm, `npx -y @taskadence/mcp`, does exactly the same with Node.js; pick whichever runtime you have.
|
|
58
|
+
|
|
59
|
+
> **`0.x` is a pre-release.** Any `0.x` release may change anything; pin a version in configs you depend on.
|
|
60
|
+
|
|
61
|
+
**Documentation:** [docs.taskadence.com](https://docs.taskadence.com/mcp/) ·
|
|
62
|
+
**Source:** [GitHub](https://github.com/indrasol/taskadence-python) · **Issues:** [GitHub issues](https://github.com/indrasol/taskadence-python/issues)
|
|
63
|
+
|
|
64
|
+
## Set up in 3 steps
|
|
65
|
+
|
|
66
|
+
You need a TasKadence account and about five minutes.
|
|
67
|
+
|
|
68
|
+
### 1. Get a token
|
|
69
|
+
|
|
70
|
+
A token is a password for programs: the assistant uses it to act for you in one organization.
|
|
71
|
+
|
|
72
|
+
1. In TasKadence, open **Developers** in the sidebar, stay on the **Tokens** tab and click **Create token**.
|
|
73
|
+
2. Give it a name you will recognise later (for example "Claude Desktop").
|
|
74
|
+
3. Under **Scopes**, tick what the assistant may do. For an assistant that only looks: **Read** on the **Tasks**,
|
|
75
|
+
**Projects** and **Teams** rows. To let it create and change things too: **Write** on those rows (Write includes
|
|
76
|
+
Read). The scopes decide which tools the assistant sees.
|
|
77
|
+
4. Click **Create token** and copy it (it starts with `tkd_live_`). **It is shown once.**
|
|
78
|
+
|
|
79
|
+
Shortcut: **Developers > MCP** in TasKadence writes the configuration for your client, with a new token already in it.
|
|
80
|
+
|
|
81
|
+
### 2. Install uv
|
|
82
|
+
|
|
83
|
+
`uvx` comes with [uv](https://docs.astral.sh/uv/getting-started/installation/), a Python tool runner. It downloads and
|
|
84
|
+
runs `taskadence-mcp` (and a suitable Python, if you have none) the first time your client starts it. Skip this step
|
|
85
|
+
if `uvx --version` already prints a version.
|
|
86
|
+
|
|
87
|
+
macOS or Linux:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Windows PowerShell:
|
|
94
|
+
|
|
95
|
+
```powershell
|
|
96
|
+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Prefer pip? `pip install taskadence-mcp` installs a `taskadence-mcp` command; then use `"command": "taskadence-mcp"`
|
|
100
|
+
and `"args": []` below. `taskadence-mcp --help` lists the options.
|
|
101
|
+
|
|
102
|
+
### 3. Add it to your client
|
|
103
|
+
|
|
104
|
+
Paste your token where the examples say `tkd_live_your_token_here`, then restart the client.
|
|
105
|
+
|
|
106
|
+
**Claude Desktop.** Open **Settings > Developer > Edit Config**. That opens `claude_desktop_config.json`, which lives
|
|
107
|
+
at `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS and
|
|
108
|
+
`%APPDATA%\Claude\claude_desktop_config.json` on Windows. Add the `taskadence` entry (keep any other servers already
|
|
109
|
+
under `mcpServers`), save, then quit Claude Desktop completely and open it again.
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"mcpServers": {
|
|
114
|
+
"taskadence": {
|
|
115
|
+
"command": "uvx",
|
|
116
|
+
"args": ["taskadence-mcp"],
|
|
117
|
+
"env": { "TASKADENCE_TOKEN": "tkd_live_your_token_here" }
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Claude Code.** One command (add `--scope user` to use it in every project):
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
claude mcp add --env TASKADENCE_TOKEN=tkd_live_your_token_here --transport stdio taskadence -- uvx taskadence-mcp
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Cursor.** Put the same JSON as Claude Desktop in `~/.cursor/mcp.json` for every project
|
|
130
|
+
(`%USERPROFILE%\.cursor\mcp.json` on Windows), or in `.cursor/mcp.json` inside one project.
|
|
131
|
+
|
|
132
|
+
**VS Code.** Put this in `.vscode/mcp.json` in your workspace, or, for every workspace, run **MCP: Open User
|
|
133
|
+
Configuration** from the Command Palette. VS Code uses `servers` and `"type": "stdio"`:
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"servers": {
|
|
138
|
+
"taskadence": {
|
|
139
|
+
"type": "stdio",
|
|
140
|
+
"command": "uvx",
|
|
141
|
+
"args": ["taskadence-mcp"],
|
|
142
|
+
"env": { "TASKADENCE_TOKEN": "tkd_live_your_token_here" }
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Keep tokens out of git: a project file (`.cursor/mcp.json`, `.vscode/mcp.json`) is easy to commit by mistake, so
|
|
149
|
+
prefer the user-level file for a config that holds a token.
|
|
150
|
+
|
|
151
|
+
## Check it works
|
|
152
|
+
|
|
153
|
+
Ask your assistant: *"Which TasKadence account and organization are you connected to?"* It should call the `whoami`
|
|
154
|
+
tool (your client may ask you to allow it first) and answer with your name and your organization. Then try *"List my
|
|
155
|
+
tasks that are in progress."*
|
|
156
|
+
|
|
157
|
+
Your client also lists its MCP servers: `taskadence` should be there, connected, with its tools (in Claude Code, type
|
|
158
|
+
`/mcp`). An error or an empty tool list means one of the problems below.
|
|
159
|
+
|
|
160
|
+
## Troubleshooting
|
|
161
|
+
|
|
162
|
+
- **"TASKADENCE_TOKEN is not set":** the `env` block is missing or the name is misspelled. Fix the config and restart
|
|
163
|
+
the client.
|
|
164
|
+
- **Token refused (401):** the error says "TasKadence refused the access token in TASKADENCE_TOKEN (401)". The token
|
|
165
|
+
was copied wrong, has expired or was revoked. Create a new one in **Developers > Tokens**, replace it in the config,
|
|
166
|
+
and restart the client.
|
|
167
|
+
- **A tool is missing, or "insufficient scope":** the token's scopes decide which tools appear. Create a token with
|
|
168
|
+
**Write** ticked to let the assistant change things (scopes cannot be added to an existing token).
|
|
169
|
+
`TASKADENCE_MCP_READONLY=1` hides every tool that writes, and `TASKADENCE_MCP_GROUPS` limits the tool groups (see
|
|
170
|
+
Configure below).
|
|
171
|
+
- **`uvx` not found (`spawn uvx ENOENT`):** install it (step 2), then restart the client. On macOS an app
|
|
172
|
+
opened from the Dock may not see your terminal's `PATH`: put the full path in `"command"` (find it with
|
|
173
|
+
`which uvx`; on Windows, `where uvx`).
|
|
174
|
+
- **Wrong Python 3.10 version:** `taskadence-mcp` needs Python 3.10 or later. Check with `python --version`.
|
|
175
|
+
- **"MCP server unreachable":** the computer cannot reach the TasKadence API. Check the network, and
|
|
176
|
+
`TASKADENCE_API_URL` if you set it.
|
|
177
|
+
|
|
178
|
+
Still stuck? Open a [GitHub issue](https://github.com/indrasol/taskadence-python/issues) with the error message and your client's name; never paste a live
|
|
179
|
+
token.
|
|
180
|
+
|
|
181
|
+
## Configure
|
|
182
|
+
|
|
183
|
+
Everything is optional except the token. Set these in the `env` block of your client's config, or pass the flags in
|
|
184
|
+
`args`.
|
|
185
|
+
|
|
186
|
+
| Variable | Flag | |
|
|
187
|
+
|---|---|---|
|
|
188
|
+
| `TASKADENCE_TOKEN` | none | **Required.** A personal access token (`tkd_live_…`). |
|
|
189
|
+
| `TASKADENCE_API_URL` | `--api-url` | The API's origin. Default: `https://api.taskadence.com`. `/mcp` is added. |
|
|
190
|
+
| `TASKADENCE_MCP_READONLY` | `--readonly` / `--no-readonly` | `1`: only tools that read, enforced by the server. |
|
|
191
|
+
| `TASKADENCE_MCP_GROUPS` | `--groups` | For example `tasks,projects`: only those tool groups. Default: every group except `admin`; `me` is always on. |
|
|
192
|
+
|
|
193
|
+
Flags win over the environment. There is no token flag: a command line is visible to every process on the machine.
|
|
194
|
+
The tools and groups are listed in [Tools](https://docs.taskadence.com/mcp/tools/).
|
|
195
|
+
|
|
196
|
+
## What it does, exactly
|
|
197
|
+
|
|
198
|
+
`taskadence-mcp` is a proxy, not a second server: it speaks MCP over stdio to your client and forwards every message to the
|
|
199
|
+
TasKadence remote MCP server (`<api>/mcp`, Streamable HTTP) with your token. The tools, the read-only and tool-group
|
|
200
|
+
enforcement, and the audit trail are the remote server's.
|
|
201
|
+
|
|
202
|
+
- stdin goes to the remote server unchanged (`initialize` included; the server is stateless), and the server's answers
|
|
203
|
+
go to stdout unchanged. stdout carries JSON-RPC and nothing else; diagnostics go to stderr, never the token.
|
|
204
|
+
- A refused token (401) is answered with a JSON-RPC error naming `TASKADENCE_TOKEN` (code `-32001`), any other HTTP
|
|
205
|
+
refusal with its status and the server's detail (`-32002`; an unknown group is a 400), an unreachable server with
|
|
206
|
+
`-32003`. Each also writes one line to stderr.
|
|
207
|
+
- It holds no tool of its own and reaches nothing but `<api>/mcp`.
|
|
208
|
+
|
|
209
|
+
## Requirements
|
|
210
|
+
|
|
211
|
+
Python 3.10 or later. Depends on `mcp` (the official MCP SDK, `<2`) and `httpx`.
|
|
212
|
+
|
|
213
|
+
## Support and security
|
|
214
|
+
|
|
215
|
+
Bugs and questions: [GitHub issues](https://github.com/indrasol/taskadence-python/issues); never paste a live token. Vulnerabilities: report them privately as
|
|
216
|
+
described in [SECURITY.md](https://github.com/indrasol/taskadence-python/blob/main/SECURITY.md) (GitHub private vulnerability reporting, or
|
|
217
|
+
srvcs.infra@indrasol.com).
|
|
218
|
+
|
|
219
|
+
## License
|
|
220
|
+
|
|
221
|
+
Apache License 2.0. See [LICENSE](https://github.com/indrasol/taskadence-python/blob/main/LICENSE). The license grants no right to use the TasKadence or
|
|
222
|
+
Indrasol names or marks.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
taskadence_mcp/__init__.py,sha256=JocCBWNDIt0cKCqa6aouDd0F0pDui-DQrTBlg5Ue4no,686
|
|
2
|
+
taskadence_mcp/__main__.py,sha256=k1ocEWawweo1qCJWNFAAvyxz3tcY13dzvCenHszij30,48
|
|
3
|
+
taskadence_mcp/_version.py,sha256=xYfYu8kWH6qTlsHY3EWOGGXeanO_73F-Q1cHode1BRs,145
|
|
4
|
+
taskadence_mcp/cli.py,sha256=bkOhHgg-yGaSu0qGl4spb-GLsBVAN6HQkVzzPSGvowE,2079
|
|
5
|
+
taskadence_mcp/config.py,sha256=eRQjBv860u0SIHbGPDNt-bCmeX3-MG_KQRGNEz2Z1FE,5533
|
|
6
|
+
taskadence_mcp/proxy.py,sha256=h4GkzurkW3HuZLuJbH5LHcUJL9mzcTPkLnI9qDn6H3Q,8220
|
|
7
|
+
taskadence_mcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
taskadence_mcp-0.1.0.dist-info/METADATA,sha256=RJBdrSANLxM9xxDfywhUFs4Y4yB1yNv9yXzYHBii4jA,11021
|
|
9
|
+
taskadence_mcp-0.1.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
10
|
+
taskadence_mcp-0.1.0.dist-info/entry_points.txt,sha256=B0pWOELRgerE4nqlm9dXAmfJmcgX6sanC7mfY0rKEtI,59
|
|
11
|
+
taskadence_mcp-0.1.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
12
|
+
taskadence_mcp-0.1.0.dist-info/licenses/NOTICE,sha256=XqW5JQItL0shyyA_LLMkQGrcfEHL_RartDaS-0EFR_A,46
|
|
13
|
+
taskadence_mcp-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|