loading…
Search for a command to run...
loading…
A personality analysis server that creates persons with traits, adds descriptions to update personality, and finds matches for job descriptions using Euclidean
A personality analysis server that creates persons with traits, adds descriptions to update personality, and finds matches for job descriptions using Euclidean distance.
A personality analysis server built using the FastMCP framework. It provides tools and resources for personality analysis and matching. The system analyzes personality traits based on friendliness and dominance scores, allowing you to create persons, define traits, and find matches for job descriptions.
The application consists of several key components:
graph TD
A[FastMCP Server] --> B[Tools: create_person, add_description, etc.]
A --> C[Resources: persons://all, traits://all]
B --> D[MCPPersonDAO]
B --> E[MCPTraitDAO]
C --> D
C --> E
D --> F[SQLite: mcp_persons.db]
E --> G[SQLite: mcp_traits.db]
Clone the repository:
git clone <repository-url>
cd mcp-traits-matcher
Create a virtual environment:
python -m uv venv .venv
Activate the virtual environment:
.venv\Scripts\activatesource .venv/bin/activateInstall dependencies:
.venv\Scripts\python.exe -m uv pip install -e .[test]
The server uses SQLite databases (mcp_persons.db and mcp_traits.db). These databases will be created automatically when the server is run. You can configure the database paths using environment variables:
export MCP_PERSONS_DB=custom_persons.db
export MCP_TRAITS_DB=custom_traits.db
Create a .env file in the project root:
MCP_PERSONS_DB=mcp_persons.db
MCP_TRAITS_DB=mcp_traits.db
LOG_LEVEL=INFO
result = await mcp.create_person(name="John Doe")
print(result) # "Person 'John Doe' created."
result = await mcp.add_description(name="John Doe", description="friendly and dominant")
print(result) # "Description added to person 'John Doe'."
result = await mcp.create_trait(name="friendly", friendliness=8.0, dominance=2.0)
print(result) # "Trait 'friendly' created with friendliness: 8.0, dominance: 2.0."
matches = await mcp.find_matches(
company_name="Acme Corp",
job_description="Looking for friendly and dominant candidates"
)
print(matches) # ["John Doe", "Jane Smith"]
import requests
response = requests.get("http://localhost:8000/persons://all")
persons = response.json()
print(persons)
| Resource | Description | Response Format |
|---|---|---|
persons://all |
Lists all persons | JSON array of person objects |
traits://all |
Lists all traits | JSON array of trait objects |
persons://{name} |
Gets a person by name | JSON object |
Example Response for persons://all:
[
{
"name": "John Doe",
"friendliness": 7.5,
"dominance": 3.2
}
]
| Tool | Parameters | Description |
|---|---|---|
create_person |
name: str |
Creates a new person with default personality scores |
add_description |
name: str, description: str |
Updates person's personality based on traits in description |
create_trait |
name: str, friendliness: float, dominance: float |
Creates a new personality trait |
find_matches |
company_name: str, job_description: str |
Finds persons matching job requirements |
The API returns appropriate HTTP status codes and error messages:
400 Bad Request: Invalid input parameters404 Not Found: Person or trait not found500 Internal Server Error: Database or server errors.venv\Scripts\python.exe -m pytest tests/
.venv\Scripts\python.exe -m src.traits_matcher_server
The server will start on http://localhost:8000
PORT=8001Enable debug logging by setting LOG_LEVEL=DEBUG in your .env file.
scipy - Scientific computing for distance calculationspydantic>=2.7.2,<3.0.0 - Data validation and serializationfastmcp - MCP frameworkpython-dotenv - Environment variable managementpytest - Testing framework (dev dependency)git checkout -b feature/amazing-featurepytestgit commit -m 'Add amazing feature'git push origin feature/amazing-featureThis project is licensed under the MIT-0 License - see the LICENSE file for details.
Выполни в терминале:
claude mcp add mcp-traits-matcher -- npx Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development