Metadata-Version: 2.5
Name: mcp-servicenex-v2
Version: 0.4.2
Summary: MCP server for the ServiceNEX REST API: tickets, workflows, knowledge, services, users, and resources
Project-URL: Homepage, https://github.com/ivedha-tech/servicenex-mcp-server-v2
Project-URL: Repository, https://github.com/ivedha-tech/servicenex-mcp-server-v2
Project-URL: Issues, https://github.com/ivedha-tech/servicenex-mcp-server-v2/issues
Author-email: Gihan Fernando <gihan.fernando@ivedha.com>, Banu Soppan <banu.soppan@ivedha.com>, Sanuka Dayarathne <sanuka.dayarathne@ivedha.com>
License-Expression: MIT
License-File: LICENSE
Keywords: knowledge-base,mcp,model-context-protocol,servicenex,tickets,workflows
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: httpx
Requires-Dist: mcp<2,>=1.28
Requires-Dist: python-dotenv
Description-Content-Type: text/markdown

# mcp-servicenex-v2

A Model Context Protocol (MCP) server for the ServiceNEX REST API.
It exposes tickets, knowledge articles, services, users, and MCP resources
to AI clients such as Claude Desktop.

## Install

Requires Python 3.10+.

```bash
pip install mcp-servicenex-v2
```

Set credentials, then start the stdio server:

```bash
export SERVICENEX_API_BASE="https://your-instance.example.com"
export SERVICENEX_API_KEY="your-api-key"
mcp-servicenex-v2
```

Or with `uvx` (no global install):

```bash
uvx mcp-servicenex-v2
```

You can also run the module directly:

```bash
python -m mcp_servicenex_v2
```

Copy `.env.example` to `.env` for local development. Host environment
variables still take precedence.

### Claude Desktop

```json
{
  "mcpServers": {
    "servicenex": {
      "command": "uvx",
      "args": ["mcp-servicenex-v2"],
      "env": {
        "SERVICENEX_API_BASE": "https://your-instance.example.com",
        "SERVICENEX_API_KEY": "your-api-key"
      }
    }
  }
}
```

If installed with pip, use `"command": "mcp-servicenex-v2"` and omit `args`.

## Environment

| Variable | Required | Description |
| --- | --- | --- |
| `SERVICENEX_API_BASE` | Yes | ServiceNEX base URL (no trailing slash required) |
| `SERVICENEX_API_KEY` | Yes | Tenant API key (`X-API-Key`) |
| `SERVICENEX_API_TIMEOUT` | No | HTTP timeout in seconds (default `120`) |
| `LOG_LEVEL` | No | Logging level (default `INFO`) |
| `TWINE_USERNAME` | Publish | Always `__token__` for API tokens |
| `TEST_PYPI_TOKEN` | Publish to TestPyPI | Token from test.pypi.org |
| `PYPI_TOKEN` | Publish to PyPI | Token from pypi.org |

## Publish

Tokens are read from the repo-root `.env` (never committed). Copy the publish
keys from `.env.example` if they are missing.

macOS / Linux (or Git Bash on Windows):

```bash
./scripts/package.sh
./scripts/publish.sh testpypi
./scripts/publish.sh pypi
```

Windows PowerShell:

```powershell
.\scripts\package.ps1
.\scripts\publish.ps1 testpypi
.\scripts\publish.ps1 pypi
```

Any OS, calling Python directly:

```bash
python scripts/release.py package
python scripts/release.py publish testpypi
python scripts/release.py publish pypi
```

The scripts need Python 3.10+ with `python-dotenv` installed (it is a runtime
dependency, so the project `.venv` already has it).

`publish.sh pypi` asks you to type the package name unless you pass `--yes`.
Build tools are installed into `.venv-build/` so the runtime `.venv` is unchanged.

## Secrets

Never commit secrets. This covers `SERVICENEX_API_KEY`, `PYPI_TOKEN`,
`TEST_PYPI_TOKEN`, and any other key or password.

- Keep real values only in the repo-root `.env` or in your shell or host
  environment. `.env` and `.env.*` are in `.gitignore`.
- `.env.example` is committed. It must contain placeholders only, such as
  `your-api-key-here`, and never real values.
- Do not put tokens in code, README examples, commit messages, or PR
  descriptions. If you use a `.pypirc`, keep it in your home directory, not in
  the repo. `.pypirc` is also in `.gitignore` as a safeguard.
- Before committing, run `git status` and `git diff --cached` and confirm that
  no `.env` file or token is staged.
- If a secret is committed or pushed, revoke it at once and create a new one
  (pypi.org → Account settings → API tokens, or the ServiceNEX tenant
  settings). Deleting the commit is not enough, because the value stays in git
  history and in any clones.
- Prefer PyPI tokens scoped to the `mcp-servicenex-v2` project over
  account-wide tokens.

## License

MIT
