Skip to content

Commit 41bb360

Browse files
authored
Changes to the Toolkit (#1)
* fix: removed the user tools, client in the config, docs - added setup readme * feat: ci checks with pre-commit * feat: moved to poetry from pip * docs: content in the main readme is updated * chore: change file name from config to settings, added logging to the client * feat: added fluentsearch tools to search within assets * fix: dependencies, project in the pyproject.toml
1 parent 3f89117 commit 41bb360

File tree

12 files changed

+1925
-232
lines changed

12 files changed

+1925
-232
lines changed

.github/workflows/checks.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Pre-commit-checks. This can be reused across all the applications.
2+
3+
name: Pre-commit Checks
4+
on:
5+
workflow_call:
6+
pull_request:
7+
types: [ opened, synchronize, labeled, reopened ]
8+
branches: "main"
9+
10+
jobs:
11+
pre-commit:
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 10
17+
steps:
18+
- uses: actions/checkout@v4
19+
#----------------------------------------------
20+
# ----- install & configure poetry -----
21+
#----------------------------------------------
22+
- name: Install Poetry
23+
uses: snok/install-poetry@v1
24+
with:
25+
version: 1.8.5
26+
virtualenvs-create: true
27+
virtualenvs-in-project: true
28+
virtualenvs-path: .venv
29+
installer-parallel: true
30+
- uses: actions/setup-python@v5
31+
with:
32+
python-version: '3.11'
33+
- name: Install dependencies
34+
run: |
35+
poetry config virtualenvs.in-project true
36+
poetry install
37+
- uses: pre-commit/[email protected]

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,7 @@ cython_debug/
157157
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158158
# and can be added to the global gitignore or merged into this file. For a more nuclear
159159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160-
#.idea/
160+
#.idea/
161+
162+
# this is generated by uv when installing deps by fastmcp server
163+
uv.lock

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ repos:
1616
hooks:
1717
- id: ruff
1818
args: [--fix]
19-
- id: ruff-format
19+
- id: ruff-format

modelcontextprotocol/README.md

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
# Atlan Model Context Protocol
22

3-
The Atlan [Model Context Protocol](https://modelcontextprotocol.io/introduction) server allows you to interact with the Atlan services through the function calling. This protocol supports various tools to interact with Atlan.
3+
The Atlan [Model Context Protocol](https://modelcontextprotocol.io/introduction) server allows you to interact with the Atlan services. This protocol supports various tools to interact with Atlan.
44

55
## Available Tools
66

77
| Tool | Description |
88
| --------------------- | ------------------------------- |
9-
| `get_user_by_username` | Get user by username |
10-
| `get_user_by_email` | Get user by email |
11-
| `get_group_by_name` | Get group by name |
12-
| `get_users_from_group` | Get users from group |
13-
| `get_trait_names` | Get trait names |
9+
1410

1511
## Installation
1612

@@ -20,49 +16,40 @@ git clone https://github.com/atlanhq/agent-toolkit.git
2016
cd agent-toolkit
2117
```
2218

23-
2. Create and activate a virtual environment:
19+
2. Install Poetry (if not already installed):
2420
```bash
25-
python -m venv .venv
26-
source .venv/bin/activate # On Unix/macOS
27-
# or
28-
.venv\Scripts\activate # On Windows
21+
curl -sSL https://install.python-poetry.org | python3 -
2922
```
3023

31-
3. Install uv package manager:
24+
3. Install dependencies and create a virtual environment:
25+
> python version should be >= 3.10
3226
```bash
33-
pip install uv
27+
poetry install
3428
```
3529

36-
4. Install dependencies using uv:
30+
4. Activate the virtual environment:
3731
```bash
38-
cd modelcontextprotocol
39-
uv pip install -e ".[dev]" # Install with development dependencies
32+
poetry shell
4033
```
4134

42-
5. Set up pre-commit hooks:
35+
5. Configure Atlan credentials:
36+
You can provide your Atlan credentials in one of two ways:
37+
38+
a. Using environment variables:
4339
```bash
44-
pre-commit install
40+
export ATLAN_BASE_URL=https://your-instance.atlan.com
41+
export ATLAN_API_KEY=your_api_key
4542
```
4643

47-
6. Set up environment variables:
48-
Create a `.env` file in the root directory and configure necessary environment variables.
49-
- check the `.env.template` file for the required variables. To generate the API key, you can refer to the [Atlan documentation](https://developer.atlan.com/getting-started/)
50-
51-
## Development
52-
53-
This project uses Ruff for linting and formatting, and pre-commit hooks to ensure code quality.
54-
55-
### Code Quality Tools
44+
b. Using a .env file (optional):
45+
Create a `.env` file in the root directory with:
46+
```
47+
ATLAN_BASE_URL=https://your-instance.atlan.com
48+
ATLAN_API_KEY=your_api_key
49+
```
5650

57-
- **Ruff**: A fast Python linter and formatter
58-
- Linting: `ruff check .`
59-
- Formatting: `ruff format .`
60-
- Auto-fix: `ruff check --fix .`
51+
To generate the API key, refer to the [Atlan documentation](https://ask.atlan.com/hc/en-us/articles/8312649180049-API-authentication).
6152

62-
- **Pre-commit**: Git hooks for code quality
63-
- Installed automatically when you run `pre-commit install`
64-
- Runs automatically on every commit
65-
- Can be run manually: `pre-commit run --all-files`
6653

6754
## Setup with Claude Desktop
6855

@@ -74,4 +61,8 @@ fastmcp install modelcontextprotocol/server.py
7461
Alternatively, you can test it with the MCP Inspector:
7562
```bash
7663
fastmcp dev modelcontextprotocol/server.py
77-
```
64+
```
65+
66+
## Contact
67+
68+
- Reach out to [email protected] for any questions or feedback.

modelcontextprotocol/client.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"""Client factory for Atlan."""
2+
3+
import logging
4+
5+
from pyatlan.client.atlan import AtlanClient
6+
7+
from settings import Settings
8+
9+
logger = logging.getLogger(__name__)
10+
11+
12+
def create_atlan_client(settings: Settings) -> AtlanClient:
13+
"""Create an Atlan client instance using the provided settings.
14+
15+
Args:
16+
settings: Application settings containing Atlan credentials
17+
18+
Returns:
19+
An initialized AtlanClient instance
20+
"""
21+
try:
22+
client = AtlanClient(
23+
base_url=settings.atlan_base_url, api_key=settings.atlan_api_key
24+
)
25+
logger.info("Atlan client created successfully")
26+
return client
27+
except Exception as e:
28+
logger.error(f"Error creating Atlan client: {e}")
29+
raise e

modelcontextprotocol/config.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

modelcontextprotocol/pyproject.toml

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)